MCPcopy Index your code
hub / github.com/ipython/ipython / test

Method test

IPython/testing/ipunittest.py:156–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

154 # normal unittest machinery (or Nose, or Trial) can find it.
155 class Tester(unittest.TestCase):
156 def test(self):
157 # Make a new runner per function to be tested
158 runner = DocTestRunner(verbose=d2u.verbose)
159 for the_test in d2u.finder.find(func, func.__name__):
160 runner.run(the_test)
161 failed = count_failures(runner)
162 if failed:
163 # Since we only looked at a single function's docstring,
164 # failed should contain at most one item. More than that
165 # is a case we can't handle and should error out on
166 if len(failed) > 1:
167 err = "Invalid number of test results: %s" % failed
168 raise ValueError(err)
169 # Report a normal failure.
170 self.fail('failed doctests: %s' % str(failed[0]))
171
172 # Rename it so test reports have the original signature.
173 Tester.__name__ = func.__name__

Callers

nothing calls this directly

Calls 3

count_failuresFunction · 0.85
findMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected