1

I am developing a bunch of inter-related classes in python with unit tests. I run the classes and tests though ipython as I go along. Using :

%run my_test_script_or_harness.py

Running this script may highlight a bug in another class, or script which I can then fix. However my problem is that I cannot get the dependencies to reload correctly. I can reload the class I am running, or the test class but this does not reload all of the other classes that I may be changing whilst debugging. IPython seems to cache the other classes, and static methods so they dont get reloaded.

This is really frustrating as I cannot run the scripts after fixing the bugs, as it thinks the old code is still there.

I have tried running:

%load_ext autoreload
%autoreload 2

from here

Reloading submodules in IPython

but that did not help.

What am I doing wrong? Should I be grouping the classes in some other way - will this help.

Any other suggestions?

Community
  • 1
  • 1
C Mars
  • 2,909
  • 4
  • 21
  • 30

0 Answers0