diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-05-15 09:21:29 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-05-15 09:21:29 -0400 |
commit | 7efac0451c9a8e2068302e2fd47913d57e00be5f (patch) | |
tree | 20bc4842cf30069e736837e6bf8f95ccad952189 /tests/backtest.py | |
parent | 2616772b7b33e76487ab9f16bcabb7c5aeb5feaf (diff) | |
download | python-coveragepy-7efac0451c9a8e2068302e2fd47913d57e00be5f.tar.gz |
Run tests with warnings on, and fix some warnings
Diffstat (limited to 'tests/backtest.py')
-rw-r--r-- | tests/backtest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/backtest.py b/tests/backtest.py index 89a2553..7b47ff1 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) |