tests: do not leak file descriptors
This commit is contained in:
parent
2ff4ba0720
commit
fef18507c7
|
@ -12,13 +12,13 @@ def pytest_generate_tests(metafunc):
|
||||||
if hasattr(metafunc, 'function'):
|
if hasattr(metafunc, 'function'):
|
||||||
fcode = metafunc.function.__code__
|
fcode = metafunc.function.__code__
|
||||||
if 'visualization' in fcode.co_varnames[:fcode.co_argcount]:
|
if 'visualization' in fcode.co_varnames[:fcode.co_argcount]:
|
||||||
tables = json.load(
|
with open(
|
||||||
open(
|
|
||||||
os.path.join(
|
os.path.join(
|
||||||
os.path.dirname(__file__),
|
os.path.dirname(__file__),
|
||||||
'fixtures',
|
'fixtures',
|
||||||
'schema2',
|
'schema2',
|
||||||
'tables.json')))
|
'tables.json')) as fd:
|
||||||
|
tables = json.load(fd)
|
||||||
metafunc.parametrize(['visualization'], [[x] for x in tables])
|
metafunc.parametrize(['visualization'], [[x] for x in tables])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue