MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_runTest_method

Function test_runTest_method

testing/test_unittest.py:27–48  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

25
26
27def test_runTest_method(pytester: Pytester) -> None:
28 pytester.makepyfile(
29 """
30 import unittest
31 class MyTestCaseWithRunTest(unittest.TestCase):
32 def runTest(self):
33 self.assertEqual('foo', 'foo')
34 class MyTestCaseWithoutRunTest(unittest.TestCase):
35 def runTest(self):
36 self.assertEqual('foo', 'foo')
37 def test_something(self):
38 pass
39 """
40 )
41 result = pytester.runpytest("-v")
42 result.stdout.fnmatch_lines(
43 """
44 *MyTestCaseWithRunTest::runTest*
45 *MyTestCaseWithoutRunTest::test_something*
46 *2 passed*
47 """
48 )
49
50
51def test_isclasscheck_issue53(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected