We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# https://docs.python.org/3/library/unittest.html#module-unittest import unittest class Simple(unittest.TestCase): def test_success(self): self.assertEqual() # Funky: docs don't' show method arguments. def test_exception(self): with self.assertRaises(Exception) as em: raise Exception exc = em.exception # Fails: doesn't infer `exception`. with self.assertRaisesRegex(ValueError, 'literal') as em2: int('XYZ') em2.exception def test_logging(self): with self.assertLogs('foo', level='INFO') as cm: pass cm.output # Fails: doesn't infer `output`. def test_subtests(self): for i in range(0, 6): with self.subTest(i=i): self.assertEqual(i % 2, 0) def load_tests(loader, tests, pattern): suite = unittest.TestSuite() for test_class in test_cases: test = loader.loadTestsfromTestCase(test_class) suite.addTests(tests) return suite if __name__ == '__main__': unittest.main()
The text was updated successfully, but these errors were encountered:
Works well with typeshed.
Sorry, something went wrong.
MikhailArkhipov
No branches or pull requests
The text was updated successfully, but these errors were encountered: