Commit 7ebb7061 authored by Ezio Melotti's avatar Ezio Melotti

Restore the global state of the log vars, so that test_cgi can be run twice without failures.

parent 6e18e042
......@@ -155,7 +155,13 @@ class CgiTests(unittest.TestCase):
cgi.logfp = None
cgi.logfile = "/dev/null"
cgi.initlog("%s", "Testing log 3")
self.addCleanup(cgi.logfp.close)
def log_cleanup():
"""Restore the global state of the log vars."""
cgi.logfile = ''
cgi.logfp.close()
cgi.logfp = None
cgi.log = cgi.initlog
self.addCleanup(log_cleanup)
cgi.log("Testing log 4")
def test_fieldstorage_readline(self):
......
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