summaryrefslogtreecommitdiff
path: root/test/test_functional.py
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-08-20 12:26:20 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2019-08-20 12:26:20 +0000
commit9fc6baca15c7fd4ea4ca65de30bd87d5bacfa131 (patch)
treed225944a57477aac99e8a4d525bde71a6957cd86 /test/test_functional.py
parentf16aef75303e54d3c7348142e6bb83164bf855b7 (diff)
downloaddocutils-9fc6baca15c7fd4ea4ca65de30bd87d5bacfa131.tar.gz
log
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8325 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/test_functional.py')
-rwxr-xr-xtest/test_functional.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_functional.py b/test/test_functional.py
index 4d8a26edf..ca72b04a9 100755
--- a/test/test_functional.py
+++ b/test/test_functional.py
@@ -126,9 +126,11 @@ expected output and check it in:
namespace['settings_overrides'] = {'_disable_config': True}
# Read the variables set in the default config file and in
# the current config file into namespace:
- defaultpy = open(join_path(datadir, 'tests', '_default.py')).read()
- exec(defaultpy, namespace)
- exec(open(self.configfile).read(), namespace)
+ with open(join_path(datadir, 'tests', '_default.py')) as f:
+ defaultpy = f.read()
+ exec(defaultpy, namespace)
+ with open(self.configfile) as f:
+ exec(f.read(), namespace)
# Check for required settings:
assert 'test_source' in namespace,\
"No 'test_source' supplied in " + self.configfile