diff options
Diffstat (limited to 'tests/test_regressions.py')
| -rw-r--r-- | tests/test_regressions.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 89828f0..406328c 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -186,9 +186,9 @@ def test_format_accepts_encoding(load_file): def test_stream(get_stream): - stream = get_stream("stream.sql") - p = sqlparse.parse(stream)[0] - assert p.get_type() == 'INSERT' + with get_stream("stream.sql") as stream: + p = sqlparse.parse(stream)[0] + assert p.get_type() == 'INSERT' def test_issue90(): @@ -238,9 +238,9 @@ def test_null_with_as(): def test_issue190_open_file(filepath): path = filepath('stream.sql') - stream = open(path) - p = sqlparse.parse(stream)[0] - assert p.get_type() == 'INSERT' + with open(path) as stream: + p = sqlparse.parse(stream)[0] + assert p.get_type() == 'INSERT' def test_issue193_splitting_function(): |
