summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index bde6d6c..ac9fcd7 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -99,6 +99,17 @@ class TestPredicates(IsTestBase):
self.assert_(inspect.isroutine(mod.spam))
self.assert_(inspect.isroutine([].count))
+ def test_get_slot_members(self):
+ class C(object):
+ __slots__ = ("a", "b")
+
+ x = C()
+ x.a = 42
+ members = dict(inspect.getmembers(x))
+ self.assert_('a' in members)
+ self.assert_('b' not in members)
+
+
class TestInterpreterStack(IsTestBase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)