summaryrefslogtreecommitdiff
path: root/tests/backtest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-05-15 09:21:29 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-05-15 09:21:29 -0400
commitf373746d5f19532c2fc690313fc13be0641eb0f6 (patch)
tree8573d2005368e3f68f1a8d2392678ea21451e7a1 /tests/backtest.py
parentdcfafdac94a31a755b958d6f47ffd09e38ea9833 (diff)
downloadpython-coveragepy-git-f373746d5f19532c2fc690313fc13be0641eb0f6.tar.gz
Run tests with warnings on, and fix some warnings
Diffstat (limited to 'tests/backtest.py')
-rw-r--r--tests/backtest.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/backtest.py b/tests/backtest.py
index 89a25536..7b47ff19 100644
--- a/tests/backtest.py
+++ b/tests/backtest.py
@@ -46,4 +46,6 @@ try:
except NameError:
def execfile(filename, globs):
"""A Python 3 implementation of execfile."""
- exec(compile(open(filename).read(), filename, 'exec'), globs)
+ with open(filename) as fobj:
+ code = fobj.read()
+ exec(compile(code, filename, 'exec'), globs)