MCPcopy Index your code
hub / github.com/RustPython/RustPython / setUp

Method setUp

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

Source from the content-addressed store, hash-verified

1613 unlink(self.source)
1614
1615 def setUp(self):
1616 self.source = TESTFN + '.py'
1617 self._clean()
1618 with open(self.source, 'w', encoding='utf-8') as fp:
1619 print('# This is a test file written by test_import.py', file=fp)
1620 sys.path.insert(0, os.curdir)
1621 importlib.invalidate_caches()
1622
1623 def tearDown(self):
1624 assert sys.path[0] == os.curdir, 'Unexpected sys.path[0]'

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected