summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-03-07 12:08:42 (GMT)
committerThomas Wouters <thomas@python.org>2006-03-07 12:08:42 (GMT)
commite34fc700fcdf0587592f3ccfb2caf5d474ac952a (patch)
tree3cbfa8d310165ac8e54a670ae8f86244c470896c /Lib/test
parenta4b4dc328f0769f90c3ebb743280b48d4eae7b7c (diff)
downloadcpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.zip
cpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.tar.gz
cpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.tar.bz2
Backport trunk's r42878 (neal.norwitz):
Thanks to Coverity, these were all reported by their Prevent tool. and r42881 (thomas.wouters): Don't DECREF a borrowed reference.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_hotshot.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py
index 721da57..4618439 100644
--- a/Lib/test/test_hotshot.py
+++ b/Lib/test/test_hotshot.py
@@ -107,6 +107,19 @@ class HotShotTestCase(unittest.TestCase):
profiler.close()
os.unlink(self.logfn)
+ def test_bad_sys_path(self):
+ import sys
+ orig_path = sys.path
+ coverage = hotshot._hotshot.coverage
+ try:
+ # verify we require a list for sys.path
+ sys.path = 'abc'
+ self.assertRaises(RuntimeError, coverage, test_support.TESTFN)
+ # verify sys.path exists
+ del sys.path
+ self.assertRaises(RuntimeError, coverage, test_support.TESTFN)
+ finally:
+ sys.path = orig_path
def test_main():
test_support.run_unittest(HotShotTestCase)