##// END OF EJS Templates
run black
dswij -
Show More
@@ -12,21 +12,22 b' from IPython.utils.syspathcontext import prepended_to_syspath'
12 12 from IPython.utils.tempdir import TemporaryDirectory
13 13 from IPython.lib.deepreload import reload as dreload
14 14
15
15 16 def test_deepreload():
16 17 "Test that dreload does deep reloads and skips excluded modules."
17 18 with TemporaryDirectory() as tmpdir:
18 19 with prepended_to_syspath(tmpdir):
19 20 tmpdirpath = Path(tmpdir)
20 with open( tmpdirpath / 'A.py' , 'w') as f:
21 with open(tmpdirpath / "A.py", "w") as f:
21 22 f.write("class Object(object):\n pass\n")
22 with open( tmpdirpath / 'B.py' , 'w') as f:
23 with open(tmpdirpath / "B.py", "w") as f:
23 24 f.write("import A\n")
24 25 import A
25 26 import B
26 27
27 28 # Test that A is not reloaded.
28 29 obj = A.Object()
29 dreload(B, exclude=['A'])
30 dreload(B, exclude=["A"])
30 31 nt.assert_true(isinstance(obj, A.Object))
31 32
32 33 # Test that A is reloaded.
General Comments 0
You need to be logged in to leave comments. Login now