#2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.

This commit is contained in:
Georg Brandl 2008-03-21 20:21:46 +00:00
parent 5a44424c5e
commit 07e5681fd3
4 changed files with 30 additions and 1 deletions

View file

@ -99,6 +99,16 @@ class TestPy3KWarnings(unittest.TestCase):
with catch_warning() as w:
self.assertWarning(sys.exc_clear(), w, expected)
def test_methods_members(self):
expected = '__members__ and __methods__ not supported in 3.x'
class C:
__methods__ = ['a']
__members__ = ['b']
c = C()
with catch_warning() as w:
self.assertWarning(dir(c), w, expected)
def test_main():
run_unittest(TestPy3KWarnings)