summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2005-09-25 11:45:45 (GMT)
committerArmin Rigo <arigo@tunes.org>2005-09-25 11:45:45 (GMT)
commitdd5c023af56b9a424a3965364521c50b73308379 (patch)
treea5523abd7d1eb9bf44ca9722f4798d49b0497503 /Lib/test/test_inspect.py
parente9f8ec98d4cd4542b5d6c5870d56a1ce1ae5d03b (diff)
downloadcpython-dd5c023af56b9a424a3965364521c50b73308379.zip
cpython-dd5c023af56b9a424a3965364521c50b73308379.tar.gz
cpython-dd5c023af56b9a424a3965364521c50b73308379.tar.bz2
some more fixes and tests for inspect.getsource(), triggered by crashes
from the PyPy project as well as the SF bug #1295909.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 1fb48c5..ce346b9 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -238,6 +238,18 @@ class TestBuggyCases(GetSourceBase):
def test_multiline_sig(self):
self.assertSourceEqual(mod2.multiline_sig[0], 63, 64)
+ def test_nested_class(self):
+ self.assertSourceEqual(mod2.func69().func71, 71, 72)
+
+ def test_one_liner_followed_by_non_name(self):
+ self.assertSourceEqual(mod2.func77, 77, 77)
+
+ def test_one_liner_dedent_non_name(self):
+ self.assertSourceEqual(mod2.cls82.func83, 83, 83)
+
+ def test_with_comment_instead_of_docstring(self):
+ self.assertSourceEqual(mod2.func88, 88, 90)
+
# Helper for testing classify_class_attrs.
def attrs_wo_objs(cls):
return [t[:3] for t in inspect.classify_class_attrs(cls)]