summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/backtest.py6
-rw-r--r--test/test_farm.py4
2 files changed, 9 insertions, 1 deletions
diff --git a/test/backtest.py b/test/backtest.py
index 4460a78d..656b35c7 100644
--- a/test/backtest.py
+++ b/test/backtest.py
@@ -47,3 +47,9 @@ except NameError:
def execfile(filename, globs):
"""A Python 3 implementation of execfile."""
exec(compile(open(filename).read(), filename, 'exec'), globs)
+
+# reload moved in Py3k
+try:
+ from imp import reload
+except:
+ reload = reload
diff --git a/test/test_farm.py b/test/test_farm.py
index 8f7d5712..006a1fb1 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -3,7 +3,7 @@
import difflib, filecmp, fnmatch, glob, os, re, shutil, sys
sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
-from backtest import run_command, execfile # pylint: disable-msg=W0622
+from backtest import run_command, execfile, reload # pylint: disable-msg=W0622
def test_farm(clean_only=False):
@@ -75,6 +75,8 @@ class FarmTestCase(object):
if self.dont_clean:
glo['clean'] = self.noop
+ glo['reload'] = reload
+
try:
execfile(self.runpy, glo)
finally: