diff --git a/tests/test_schema2.py b/tests/test_schema2.py index f5d4b86..57b32e9 100644 --- a/tests/test_schema2.py +++ b/tests/test_schema2.py @@ -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])