MCPcopy
hub / github.com/pytest-dev/pytest / test_simple_unittest

Function test_simple_unittest

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

Source from the content-addressed store, hash-verified

10
11
12def test_simple_unittest(pytester: Pytester) -> None:
13 testpath = pytester.makepyfile(
14 """
15 import unittest
16 class MyTestCase(unittest.TestCase):
17 def testpassing(self):
18 self.assertEqual('foo', 'foo')
19 def test_failing(self):
20 self.assertEqual('foo', 'bar')
21 """
22 )
23 reprec = pytester.inline_run(testpath)
24 assert reprec.matchreport("testpassing").passed
25 assert reprec.matchreport("test_failing").failed
26
27
28def test_runTest_method(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

matchreportMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected