summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-30 03:19:06 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-30 03:19:06 (GMT)
commit0503de9c83b3fb3545d8fe34ad560ec3fc56a63b (patch)
tree73f7a2720cd554b1b470a72cbccaf05f7fc63254 /Lib/test/test_inspect.py
parent8c0fc15c411b577f310613e23724e985f1d2cf73 (diff)
parent1b145927d725b136b987df220dff0ec7529b6f29 (diff)
downloadcpython-0503de9c83b3fb3545d8fe34ad560ec3fc56a63b.zip
cpython-0503de9c83b3fb3545d8fe34ad560ec3fc56a63b.tar.gz
cpython-0503de9c83b3fb3545d8fe34ad560ec3fc56a63b.tar.bz2
#17526: merge with 3.3.
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 66ffe91..6bd9bd1 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'