tests: do not leak file descriptors

This commit is contained in:
Benjamin Dauvergne 2020-06-19 16:28:00 +02:00
parent 2ff4ba0720
commit fef18507c7
1 changed files with 3 additions and 3 deletions

View File

@ -12,13 +12,13 @@ def pytest_generate_tests(metafunc):
if hasattr(metafunc, 'function'):
fcode = metafunc.function.__code__
if 'visualization' in fcode.co_varnames[:fcode.co_argcount]:
tables = json.load(
open(
with open(
os.path.join(
os.path.dirname(__file__),
'fixtures',
'schema2',
'tables.json')))
'tables.json')) as fd:
tables = json.load(fd)
metafunc.parametrize(['visualization'], [[x] for x in tables])