diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test___all__.py | 1 | ||||
-rw-r--r-- | Lib/test/test_optparse.py | 12 | ||||
-rw-r--r-- | Lib/test/test_set.py | 11 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 2 |
4 files changed, 23 insertions, 3 deletions
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index e4f0f44..d8e850a 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -132,7 +132,6 @@ class AllTest(unittest.TestCase): self.check_all("rlcompleter") self.check_all("robotparser") self.check_all("sched") - self.check_all("sets") self.check_all("sgmllib") self.check_all("shelve") self.check_all("shlex") diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index aa6525e..e05fbc6 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -1500,8 +1500,16 @@ class TestHelp(BaseTest): self.assertHelpEquals(_expected_help_long_opts_first) def test_help_title_formatter(self): - self.parser.formatter = TitledHelpFormatter() - self.assertHelpEquals(_expected_help_title_formatter) + save = os.environ.get("COLUMNS") + try: + os.environ["COLUMNS"] = "80" + self.parser.formatter = TitledHelpFormatter() + self.assertHelpEquals(_expected_help_title_formatter) + finally: + if save is not None: + os.environ["COLUMNS"] = save + else: + del os.environ["COLUMNS"] def test_wrap_columns(self): # Ensure that wrapping respects $COLUMNS environment variable. diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 0d08b79..a1c797c 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -476,6 +476,16 @@ class SetSubclass(set): class TestSetSubclass(TestSet): thetype = SetSubclass +class SetSubclassWithKeywordArgs(set): + def __init__(self, iterable=[], newarg=None): + set.__init__(self, iterable) + +class TestSetSubclassWithKeywordArgs(TestSet): + + def test_keywords_in_subclass(self): + 'SF bug #1486663 -- this used to erroneously raise a TypeError' + SetSubclassWithKeywordArgs(newarg=1) + class TestFrozenSet(TestJointOps): thetype = frozenset @@ -1454,6 +1464,7 @@ def test_main(verbose=None): test_classes = ( TestSet, TestSetSubclass, + TestSetSubclassWithKeywordArgs, TestFrozenSet, TestFrozenSetSubclass, TestSetOfSets, diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index fcc0f45..1b34d61 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -430,6 +430,8 @@ class ProcessTestCase(unittest.TestCase): '"a\\\\b c" d e') self.assertEqual(subprocess.list2cmdline(['a\\\\b\\ c', 'd', 'e']), '"a\\\\b\\ c" d e') + self.assertEqual(subprocess.list2cmdline(['ab', '']), + 'ab ""') def test_poll(self): |