mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
#2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.
This commit is contained in:
parent
5a44424c5e
commit
07e5681fd3
4 changed files with 30 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue