def test_it_exits_unsuccessfully_for_unknown_reporters(self): with self.assertRaises(SystemExit) as e: cli.main( [ "--reporter", "non-existent reporter", "virtue.tests.samples.one_unsuccessful_test", ], ) self.assertNotEqual(e.exception.code, os.EX_OK)
def test_it_exits_successfully_for_successful_runs(self): with self.assertRaises(SystemExit) as e: cli.main( [ "--reporter", "summary", "virtue.tests.samples.one_successful_test", ], ) self.assertEqual(e.exception.code, os.EX_OK)