diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 16:40:48 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 16:40:48 (GMT) |
commit | af5facc4cace578700ae2b74524c62e8790d4763 (patch) | |
tree | 0faa3dbecc162b386783f495cba9917090dcabed /Lib/test/test_inspect.py | |
parent | bb5b92d324c06e586dfaef1c980e3de2e94e86ae (diff) | |
parent | 0c60381749cfb9af804cf3f961a110797ee192d9 (diff) | |
download | cpython-af5facc4cace578700ae2b74524c62e8790d4763.zip cpython-af5facc4cace578700ae2b74524c62e8790d4763.tar.gz cpython-af5facc4cace578700ae2b74524c62e8790d4763.tar.bz2 |
Add part of test_inspect test from 2.7
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index ef0d939..7407c1c 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -650,6 +650,17 @@ class TestClassesAndFunctions(unittest.TestCase): self.assertEqual(inspect.getmembers(B, isdatadescriptor), [('dd', A.__dict__['dd'])]) + def test_getmembers_method(self): + class B: + def f(self): + pass + + self.assertIn(('f', B.f), inspect.getmembers(B)) + self.assertNotIn(('f', B.f), inspect.getmembers(B, inspect.ismethod)) + b = B() + self.assertIn(('f', b.f), inspect.getmembers(b)) + self.assertIn(('f', b.f), inspect.getmembers(b, inspect.ismethod)) + class TestGetcallargsFunctions(unittest.TestCase): |