mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add part of test_inspect test from 2.7
This commit is contained in:
parent
fc1b6f0078
commit
0c60381749
1 changed files with 11 additions and 0 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue