Skip to content

Commit

Permalink
Moar resource leak patchage.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Feb 28, 2013
1 parent 79bcc42 commit 166c5b7
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/ZODB/tests/testConfig.py
Expand Up @@ -61,28 +61,28 @@ def test_map_config2(self):
""")

def test_file_config1(self):
path = tempfile.mktemp()
self._test(
"""
with tempfile.NamedTemporaryFile(prefix='Cfg') as f:
self._test(
"""
<zodb>
<filestorage>
path %s
</filestorage>
</zodb>
""" % f.name)

def test_file_config2(self):
with tempfile.NamedTemporaryFile(prefix='Cfg') as f:
cfg = """
<zodb>
<filestorage>
<filestorage>
path %s
</filestorage>
create false
read-only true
</filestorage>
</zodb>
""" % path)

def test_file_config2(self):
path = tempfile.mktemp()
cfg = """
<zodb>
<filestorage>
path %s
create false
read-only true
</filestorage>
</zodb>
""" % path
self.assertRaises(ReadOnlyError, self._test, cfg)
""" % f.name
self.assertRaises(ReadOnlyError, self._test, cfg)

def test_demo_config(self):
cfg = """
Expand Down

0 comments on commit 166c5b7

Please sign in to comment.