Commit ee4514ce authored by Jason Madden's avatar Jason Madden

Fix zdoptions.test and dynamic_server_ports.test under PyPy by closing the files.

parent 68b48d4b
...@@ -82,7 +82,8 @@ dynamic port using ZConfig, you'd use a hostname by itself. In this ...@@ -82,7 +82,8 @@ dynamic port using ZConfig, you'd use a hostname by itself. In this
case, ZConfig passes None as the port. case, ZConfig passes None as the port.
>>> import ZEO.runzeo >>> import ZEO.runzeo
>>> r = open('conf', 'w').write(""" >>> with open('conf', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 127.0.0.1 ... address 127.0.0.1
... </zeo> ... </zeo>
...@@ -103,4 +104,3 @@ case, ZConfig passes None as the port. ...@@ -103,4 +104,3 @@ case, ZConfig passes None as the port.
.. cleanup .. cleanup
>>> ZODB.event.notify = old_notify >>> ZODB.event.notify = old_notify
...@@ -16,13 +16,14 @@ It is an error not to specify any storages: ...@@ -16,13 +16,14 @@ It is an error not to specify any storages:
... from io import StringIO ... from io import StringIO
>>> stderr = sys.stderr >>> stderr = sys.stderr
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
... """) ... """)
>>> sys.stderr = StringIO() >>> sys.stderr = StringIO()
>>> options = ZEO.runzeo.ZEOOptions() >>> options = ZEO.runzeo.ZEOOptions()
>>> options.realize('-C config'.split()) >>> options.realize('-C config'.split())
Traceback (most recent call last): Traceback (most recent call last):
...@@ -37,7 +38,8 @@ It is an error not to specify any storages: ...@@ -37,7 +38,8 @@ It is an error not to specify any storages:
But we can specify a storage without a name: But we can specify a storage without a name:
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
...@@ -51,8 +53,9 @@ But we can specify a storage without a name: ...@@ -51,8 +53,9 @@ But we can specify a storage without a name:
We can't have multiple unnamed storages: We can't have multiple unnamed storages:
>>> sys.stderr = StringIO() >>> sys.stderr = StringIO()
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
...@@ -73,8 +76,9 @@ We can't have multiple unnamed storages: ...@@ -73,8 +76,9 @@ We can't have multiple unnamed storages:
Or an unnamed storage and one named '1': Or an unnamed storage and one named '1':
>>> sys.stderr = StringIO() >>> sys.stderr = StringIO()
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
...@@ -95,7 +99,8 @@ Or an unnamed storage and one named '1': ...@@ -95,7 +99,8 @@ Or an unnamed storage and one named '1':
But we can have multiple storages: But we can have multiple storages:
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... _ = f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
...@@ -111,8 +116,9 @@ But we can have multiple storages: ...@@ -111,8 +116,9 @@ But we can have multiple storages:
As long as the names are unique: As long as the names are unique:
>>> sys.stderr = StringIO() >>> sys.stderr = StringIO()
>>> r = open('config', 'w').write(""" >>> with open('config', 'w') as f:
... f.write("""
... <zeo> ... <zeo>
... address 8100 ... address 8100
... </zeo> ... </zeo>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment