mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
warn about some members of the commands module
This commit is contained in:
parent
b17ad2de08
commit
3aa84a7f28
3 changed files with 20 additions and 1 deletions
|
@ -212,6 +212,15 @@ class TestStdlibRemovals(unittest.TestCase):
|
|||
mod.walk(".", dumbo, None)
|
||||
self.assertEquals(str(w.message), msg)
|
||||
|
||||
def test_commands_members(self):
|
||||
import commands
|
||||
members = {"mk2arg" : 2, "mkarg" : 1, "getstatus" : 1}
|
||||
for name, arg_count in members.items():
|
||||
with catch_warning(record=False):
|
||||
warnings.filterwarnings("error")
|
||||
func = getattr(commands, name)
|
||||
self.assertRaises(DeprecationWarning, func, *([None]*arg_count))
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(TestPy3KWarnings,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue