summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-01-06 17:43:06 (GMT)
committerGeorg Brandl <georg@python.org>2010-01-06 17:43:06 (GMT)
commit5089a38af2b90dfe51bbf157ff38227c85eff687 (patch)
treeb53b42a59b8833d131148978349115ddbe494484 /Lib/test
parent202eb9094cc9c504adb1ec122a233a3a19b35b7c (diff)
downloadcpython-5089a38af2b90dfe51bbf157ff38227c85eff687.zip
cpython-5089a38af2b90dfe51bbf157ff38227c85eff687.tar.gz
cpython-5089a38af2b90dfe51bbf157ff38227c85eff687.tar.bz2
Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_cmd.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index c08df0b..8898a32 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -143,7 +143,7 @@ class samplecmdclass(cmd.Cmd):
print "complete command"
return
- def do_shell(self):
+ def do_shell(self, s):
pass
def do_add(self, s):
@@ -169,8 +169,8 @@ def test_main(verbose=None):
from test import test_support, test_cmd
test_support.run_doctest(test_cmd, verbose)
-import trace, sys
def test_coverage(coverdir):
+ import trace
tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
trace=0, count=1)
tracer.run('reload(cmd);test_main()')
@@ -181,5 +181,7 @@ def test_coverage(coverdir):
if __name__ == "__main__":
if "-c" in sys.argv:
test_coverage('/tmp/cmd.cover')
+ elif "-i" in sys.argv:
+ samplecmdclass().cmdloop()
else:
test_main()