##// END OF EJS Templates
Call invalidate_caches() when testing installing extension.
Thomas Kluyver -
Show More
@@ -15,6 +15,12 b' import sys'
15 from StringIO import StringIO
15 from StringIO import StringIO
16 from unittest import TestCase
16 from unittest import TestCase
17
17
18 try:
19 from importlib import invalidate_caches # Required from Python 3.3
20 except ImportError:
21 def invalidate_caches():
22 pass
23
18 import nose.tools as nt
24 import nose.tools as nt
19
25
20 from IPython.core import magic
26 from IPython.core import magic
@@ -449,6 +455,7 b' def test_extension():'
449 url = os.path.join(os.path.dirname(__file__), "daft_extension.py")
455 url = os.path.join(os.path.dirname(__file__), "daft_extension.py")
450 _ip.magic("install_ext %s" % url)
456 _ip.magic("install_ext %s" % url)
451 _ip.user_ns.pop('arq', None)
457 _ip.user_ns.pop('arq', None)
458 invalidate_caches() # Clear import caches
452 _ip.magic("load_ext daft_extension")
459 _ip.magic("load_ext daft_extension")
453 tt.assert_equal(_ip.user_ns['arq'], 185)
460 tt.assert_equal(_ip.user_ns['arq'], 185)
454 _ip.magic("unload_ext daft_extension")
461 _ip.magic("unload_ext daft_extension")
General Comments 0
You need to be logged in to leave comments. Login now