aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/doctest.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2012-12-29 06:23:09 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2012-12-29 06:23:09 +0100
commit721559fe76a1cda3de639ee2aaa446595169d26b (patch)
treea33afb83c609e4124c7f78fa79ded12f9f139f8a /setuptools/tests/doctest.py
parent5f6ebc0579291a7dd316e2a64466e688ef7bdb69 (diff)
downloadexternal_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.tar.gz
external_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.tar.bz2
external_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.zip
Fix some ResourceWarnings.
--HG-- branch : distribute extra : rebase_source : 31ac3f0135d8cfe0fabc274f1649d1c99eba2868
Diffstat (limited to 'setuptools/tests/doctest.py')
-rw-r--r--setuptools/tests/doctest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/tests/doctest.py b/setuptools/tests/doctest.py
index be399a9d..cc1e06c3 100644
--- a/setuptools/tests/doctest.py
+++ b/setuptools/tests/doctest.py
@@ -1968,7 +1968,9 @@ def testfile(filename, module_relative=True, name=None, package=None,
runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
# Read the file, convert it to a test, and run it.
- s = open(filename).read()
+ f = open(filename)
+ s = f.read()
+ f.close()
test = parser.get_doctest(s, globs, name, filename, 0)
runner.run(test)
@@ -2353,7 +2355,9 @@ def DocFileTest(path, module_relative=True, package=None,
# Find the file and read it.
name = os.path.basename(path)
- doc = open(path).read()
+ f = open(path)
+ doc = f.read()
+ f.close()
# Convert it to a test, and wrap it in a DocFileCase.
test = parser.get_doctest(doc, globs, name, path, 0)