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

Method setUp

bpython/test/test_curtsies_repl.py:325–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

323
324class TestCurtsiesReevaluateWithImport(TestCase):
325 def setUp(self):
326 self.repl = create_repl()
327 self.open = partial(io.open, mode="wt", encoding="utf-8")
328 self.dont_write_bytecode = sys.dont_write_bytecode
329 sys.dont_write_bytecode = True
330 self.sys_path = sys.path
331 sys.path = self.sys_path[:]
332
333 # Because these tests create Python source files at runtime,
334 # it's possible in Python >=3.3 for the importlib.machinery.FileFinder
335 # for a directory to have an outdated cache when
336 # * a module in that directory is imported,
337 # * then a new module is created in that directory,
338 # * then that new module is imported.
339 # Automatic cache invalidation is based on the second-resolution mtime
340 # of the directory, so we need to manually call invalidate_caches().
341 #
342 # see https://docs.python.org/3/library/importlib.html
343 # sections #importlib.machinery.FileFinder and
344 # #importlib.invalidate_caches
345 invalidate_caches()
346
347 def tearDown(self):
348 sys.dont_write_bytecode = self.dont_write_bytecode

Callers

nothing calls this directly

Calls 1

create_replFunction · 0.70

Tested by

no test coverage detected