Commit 8573d62f authored by Neil Schemenauer's avatar Neil Schemenauer

Fix broken test in test_hotshot. Treating the current directory as an

empty file is sloppy and non-portable.  Use NamedTemporaryFile to make
an empty file.
parent 34feea32
......@@ -3,6 +3,7 @@ import hotshot.log
import os
import pprint
import unittest
import tempfile
import _hotshot
import gc
......@@ -127,7 +128,12 @@ class HotShotTestCase(unittest.TestCase):
os.remove(test_support.TESTFN)
def test_logreader_eof_error(self):
self.assertRaises((IOError, EOFError), _hotshot.logreader, ".")
emptyfile = tempfile.NamedTemporaryFile()
try:
self.assertRaises((IOError, EOFError), _hotshot.logreader,
emptyfile.name)
finally:
emptyfile.close()
gc.collect()
def test_main():
......
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