From 9fc6baca15c7fd4ea4ca65de30bd87d5bacfa131 Mon Sep 17 00:00:00 2001 From: grubert Date: Tue, 20 Aug 2019 12:26:20 +0000 Subject: log git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8325 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_functional.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/test_functional.py') 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 -- cgit v1.2.1