summaryrefslogtreecommitdiff
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-03-30 16:29:54 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2013-03-30 16:29:54 +0100
commit9498839a1a29205d65c798a3a6bca272430b83c1 (patch)
treec4d19e95481f2d72fb86584eabf5c1cb925f8a40 /Lib/test/test_inspect.py
parent912fbff1053c7ebadced3233b18fb951e6d15399 (diff)
parent3fdd4f1935ba1bb4b45d77ed99281b134f3e6d24 (diff)
downloadcpython-git-9498839a1a29205d65c798a3a6bca272430b83c1.tar.gz
Merge
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 66ffe9133e..6bd9bd1544 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -416,6 +416,12 @@ class TestBuggyCases(GetSourceBase):
finally:
del linecache.cache[co.co_filename]
+ def test_findsource_without_filename(self):
+ for fname in ['', '<string>']:
+ co = compile('x=1', fname, "exec")
+ self.assertRaises(IOError, inspect.findsource, co)
+ self.assertRaises(IOError, inspect.getsource, co)
+
class TestNoEOL(GetSourceBase):
def __init__(self, *args, **kwargs):
self.tempdir = TESTFN + '_dir'