MCPcopy Create free account
hub / github.com/ipython/ipython / test

Method test

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

Source from the content-addressed store, hash-verified

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