From: Matt Chisholm Date: Mon, 14 Apr 2014 17:27:59 +0000 (-0400) Subject: fix unclosed file ResourceWarning X-Git-Tag: rel_0_9_5~78^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cefa27709695318a36279567dee6db67746e414;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix unclosed file ResourceWarning part of #2830 --- diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 91e467aed0..e887e2a7ec 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -1218,7 +1218,8 @@ class BinaryTest(fixtures.TestBase, AssertsExecutionResults): def load_stream(self, name): f = os.path.join(os.path.dirname(__file__), "..", name) - return open(f, mode='rb').read() + with open(f, mode='rb') as o: + return o.read() class ExpressionTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): __dialect__ = 'default'