]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix unclosed file ResourceWarning
authorMatt Chisholm <matt@theory.org>
Mon, 14 Apr 2014 17:27:59 +0000 (13:27 -0400)
committerMatt Chisholm <matt@theory.org>
Mon, 14 Apr 2014 17:27:59 +0000 (13:27 -0400)
part of #2830

test/sql/test_types.py

index 91e467aed0e34969e06c9fd18eaf08bd7c9fa0c3..e887e2a7ec7cc32b2121826ae9a00e98ed0d6439 100644 (file)
@@ -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'