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

Method test_alreadyloaded

Lib/test/test_pkgutil.py:390–398  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

388 del sys.modules['foo']
389
390 def test_alreadyloaded(self):
391 # Ensure that get_data works without reloading - the "loads" module
392 # variable in the example loader should count how many times a reload
393 # occurs.
394 import foo
395 self.assertEqual(foo.loads, 1)
396 self.assertEqual(pkgutil.get_data('foo', 'dummy'), "Hello, world!")
397 self.assertEqual(foo.loads, 1)
398 del sys.modules['foo']
399
400
401# These tests, especially the setup and cleanup, are hideous. They

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected