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

Function test_simple_unittest

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

Source from the content-addressed store, hash-verified

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