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

Method setUp

Lib/test/test_import/__init__.py:1662–1668  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1660 unlink(self.source)
1661
1662 def setUp(self):
1663 self.source = TESTFN + '.py'
1664 self._clean()
1665 with open(self.source, 'w', encoding='utf-8') as fp:
1666 print('# This is a test file written by test_import.py', file=fp)
1667 sys.path.insert(0, os.curdir)
1668 importlib.invalidate_caches()
1669
1670 def tearDown(self):
1671 assert sys.path[0] == os.curdir, 'Unexpected sys.path[0]'

Callers

nothing calls this directly

Calls 4

_cleanMethod · 0.95
openFunction · 0.50
insertMethod · 0.45
invalidate_cachesMethod · 0.45

Tested by

no test coverage detected