MCPcopy Index your code
hub / github.com/python/cpython / test_only_source

Method test_only_source

Lib/test/test_inspect/test_inspect.py:6498–6505  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6496
6497class TestMain(unittest.TestCase):
6498 def test_only_source(self):
6499 module = importlib.import_module('unittest')
6500 rc, out, err = assert_python_ok('-m', 'inspect',
6501 'unittest')
6502 lines = out.decode().splitlines()
6503 # ignore the final newline
6504 self.assertEqual(lines[:-1], inspect.getsource(module).splitlines())
6505 self.assertEqual(err, b'')
6506
6507 def test_custom_getattr(self):
6508 def foo():

Callers

nothing calls this directly

Calls 5

assert_python_okFunction · 0.90
import_moduleMethod · 0.45
splitlinesMethod · 0.45
decodeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected