MCPcopy Index your code
hub / github.com/python/cpython / test_ExitAsDefault

Method test_ExitAsDefault

Lib/test/test_unittest/test_program.py:164–177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

162 self.assertEndsWith(out, expected)
163
164 def test_ExitAsDefault(self):
165 stream = BufferedWriter()
166 with self.assertRaises(SystemExit):
167 unittest.main(
168 argv=["foobar"],
169 testRunner=unittest.TextTestRunner(stream=stream),
170 testLoader=self.TestLoader(self.FooBar))
171 out = stream.getvalue()
172 self.assertIn('\nFAIL: testFail ', out)
173 self.assertIn('\nERROR: testError ', out)
174 self.assertIn('\nUNEXPECTED SUCCESS: testUnexpectedSuccess ', out)
175 expected = ('\n\nFAILED (failures=1, errors=1, skipped=1, '
176 'expected failures=1, unexpected successes=1)\n')
177 self.assertEndsWith(out, expected)
178
179 def test_ExitSkippedSuite(self):
180 stream = BufferedWriter()

Callers

nothing calls this directly

Calls 6

getvalueMethod · 0.95
assertInMethod · 0.80
assertEndsWithMethod · 0.80
BufferedWriterClass · 0.70
assertRaisesMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected