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

Method check_output

IPython/testing/plugin/ipdoctest.py:179–193  ·  view source on GitHub ↗

Check output, accepting special markers embedded in the output. If the output didn't pass the default validation but the special string '#random' is included, we accept it.

(self, want, got, optionflags)

Source from the content-addressed store, hash-verified

177 random_re = re.compile(r'#\s*random\s+')
178
179 def check_output(self, want, got, optionflags):
180 """Check output, accepting special markers embedded in the output.
181
182 If the output didn't pass the default validation but the special string
183 '#random' is included, we accept it."""
184
185 # Let the original tester verify first, in case people have valid tests
186 # that happen to have a comment saying '#random' embedded in.
187 ret = doctest.OutputChecker.check_output(self, want, got,
188 optionflags)
189 if not ret and self.random_re.search(want):
190 #print >> sys.stderr, 'RANDOM OK:',want # dbg
191 return True
192
193 return ret
194
195
196class DocTestCase(doctests.DocTestCase):

Callers 1

make_tarball.pyFile · 0.80

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected