diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/string_tests.py | 1 | ||||
-rw-r--r-- | Lib/test/test_capi.py | 4 | ||||
-rw-r--r-- | Lib/test/test_codecs.py | 4 | ||||
-rw-r--r-- | Lib/test/test_csv.py | 24 | ||||
-rw-r--r-- | Lib/test/test_getargs2.py | 2 | ||||
-rw-r--r-- | Lib/test/test_gettext.py | 2 | ||||
-rw-r--r-- | Lib/test/test_macfs.py | 2 | ||||
-rw-r--r-- | Lib/test/test_pwd.py | 1 | ||||
-rw-r--r-- | Lib/test/test_scriptpackages.py | 18 | ||||
-rw-r--r-- | Lib/test/test_shlex.py | 4 | ||||
-rw-r--r-- | Lib/test/test_signal.py | 1 | ||||
-rw-r--r-- | Lib/test/test_stringprep.py | 2 | ||||
-rw-r--r-- | Lib/test/test_time.py | 10 | ||||
-rw-r--r-- | Lib/test/test_unicode_file.py | 2 |
14 files changed, 36 insertions, 41 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 591b409..7c98a3b 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -631,4 +631,3 @@ class MixinStrUserStringTest: self.checkraises(TypeError, 'xyz', 'decode', 42) self.checkraises(TypeError, 'xyz', 'encode', 42) - diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 57cc9b8..82bded4 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -27,7 +27,7 @@ def TestThreadState(): def callback(): idents.append(thread.get_ident()) - + _testcapi._test_thread_state(callback) time.sleep(1) # Check our main thread is in the list exactly 3 times. @@ -40,6 +40,6 @@ try: have_thread_state = True except AttributeError: have_thread_state = False - + if have_thread_state: TestThreadState() diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 17395d3..d451c1b 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -105,7 +105,7 @@ punycode_testcases = [ #(L) 3<nen>B<gumi><kinpachi><sensei> (u"\u0033\u5E74\u0042\u7D44\u91D1\u516B\u5148\u751F", "3B-ww4c5e180e575a65lsy2b"), - + # (M) <amuro><namie>-with-SUPER-MONKEYS (u"\u5B89\u5BA4\u5948\u7F8E\u6075\u002D\u0077\u0069\u0074" u"\u0068\u002D\u0053\u0055\u0050\u0045\u0052\u002D\u004D" @@ -264,7 +264,7 @@ nameprep_tests = [ ('\xe2\xbf\xb5', None), # 3.33 Display property character U+0341. - ('\xcd\x81', + ('\xcd\x81', '\xcc\x81'), # 3.34 Left-to-right mark U+200E. ('\xe2\x80\x8e', diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py index 7ee1fac..3545893 100644 --- a/Lib/test/test_csv.py +++ b/Lib/test/test_csv.py @@ -10,7 +10,7 @@ from test.test_support import verbose class Test_Csv(unittest.TestCase): """ - Test the underlying C csv parser in ways that are not appropriate + Test the underlying C csv parser in ways that are not appropriate from the high level interface. Further tests of this nature are done in TestDialectRegistry. """ @@ -38,7 +38,7 @@ class Test_Csv(unittest.TestCase): obj.dialect.delimiter = '\t' self.assertEqual(obj.dialect.delimiter, '\t') self.assertRaises(TypeError, delattr, obj.dialect, 'delimiter') - self.assertRaises(TypeError, setattr, obj.dialect, + self.assertRaises(TypeError, setattr, obj.dialect, 'lineterminator', None) obj.dialect.escapechar = None self.assertEqual(obj.dialect.escapechar, None) @@ -57,14 +57,14 @@ class Test_Csv(unittest.TestCase): fileobj = StringIO() writer = csv.writer(fileobj, **kwargs) writer.writerow(fields) - self.assertEqual(fileobj.getvalue(), + self.assertEqual(fileobj.getvalue(), expect + writer.dialect.lineterminator) def test_write_arg_valid(self): self.assertRaises(csv.Error, self._write_test, None, '') self._write_test((), '') self._write_test([None], '""') - self.assertRaises(csv.Error, self._write_test, + self.assertRaises(csv.Error, self._write_test, [None], None, quoting = csv.QUOTE_NONE) # Check that exceptions are passed up the chain class BadList: @@ -87,7 +87,7 @@ class Test_Csv(unittest.TestCase): def test_write_quoting(self): self._write_test(['a','1','p,q'], 'a,1,"p,q"') - self.assertRaises(csv.Error, + self.assertRaises(csv.Error, self._write_test, ['a','1','p,q'], 'a,1,"p,q"', quoting = csv.QUOTE_NONE) @@ -311,15 +311,15 @@ class TestDialectExcel(TestCsvBase): self.readerAssertEqual(' "a"', [[' "a"']]) def test_quoted(self): - self.readerAssertEqual('1,2,3,"I think, therefore I am",5,6', - [['1', '2', '3', - 'I think, therefore I am', + self.readerAssertEqual('1,2,3,"I think, therefore I am",5,6', + [['1', '2', '3', + 'I think, therefore I am', '5', '6']]) def test_quoted_quote(self): self.readerAssertEqual('1,2,3,"""I see,"" said the blind man","as he picked up his hammer and saw"', - [['1', '2', '3', - '"I see," said the blind man', + [['1', '2', '3', + '"I see," said the blind man', 'as he picked up his hammer and saw']]) def test_quoted_nl(self): @@ -329,8 +329,8 @@ said the blind man","as he picked up his hammer and saw" 9,8,7,6''' self.readerAssertEqual(input, - [['1', '2', '3', - '"I see,"\nsaid the blind man', + [['1', '2', '3', + '"I see,"\nsaid the blind man', 'as he picked up his\nhammer and saw'], ['9','8','7','6']]) diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 53ad20c..0096c91 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -199,7 +199,7 @@ class LongLong_TestCase(unittest.TestCase): self.failUnlessEqual(42, ll_convert("L", 42)) self.failUnlessEqual(42, ll_convert("L", 42L)) self.assertRaises(OverflowError, ll_convert, "L", VERY_LARGE) - + def test_K(self): # K return 'unsigned long long', no range checking self.assertRaises(TypeError, ull_convert, "K", 3.14) diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index c7840cd..fc3b941 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -296,7 +296,7 @@ def suite(): suite.addTest(unittest.makeSuite(PluralFormsTestCase)) suite.addTest(unittest.makeSuite(UnicodeTranslationsTest)) return suite - + def test_main(): run_suite(suite()) diff --git a/Lib/test/test_macfs.py b/Lib/test/test_macfs.py index ad6db88..3d32e71 100644 --- a/Lib/test/test_macfs.py +++ b/Lib/test/test_macfs.py @@ -29,7 +29,7 @@ class TestMacfs(unittest.TestCase): def test_fsref(self): fsr = macfs.FSRef(test_support.TESTFN) self.assertEqual(os.path.realpath(test_support.TESTFN), fsr.as_pathname()) - + def test_fsref_unicode(self): if sys.getfilesystemencoding(): testfn_unicode = unicode(test_support.TESTFN) diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index dbdea79..9200043 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -92,4 +92,3 @@ def test_main(): if __name__ == "__main__": test_main() - diff --git a/Lib/test/test_scriptpackages.py b/Lib/test/test_scriptpackages.py index 27adf8c..a2e03f9 100644 --- a/Lib/test/test_scriptpackages.py +++ b/Lib/test/test_scriptpackages.py @@ -8,7 +8,7 @@ from test import test_support import aetools class TestScriptpackages(unittest.TestCase): - + def _test_scriptpackage(self, package, testobject=1): # Check that we can import the package mod = __import__(package) @@ -19,28 +19,28 @@ class TestScriptpackages(unittest.TestCase): if testobject: # Test that we can get an application object obj = mod.application(0) - + def test__builtinSuites(self): self._test_scriptpackage('_builtinSuites', testobject=0) - + def test_StdSuites(self): self._test_scriptpackage('StdSuites') - + def test_SystemEvents(self): self._test_scriptpackage('SystemEvents') - + def test_Finder(self): self._test_scriptpackage('Finder') - + def test_Terminal(self): self._test_scriptpackage('Terminal') - + def test_Netscape(self): self._test_scriptpackage('Netscape') - + def test_Explorer(self): self._test_scriptpackage('Explorer') - + def test_CodeWarrior(self): self._test_scriptpackage('CodeWarrior') diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py index 1678c7d..5c6572a 100644 --- a/Lib/test/test_shlex.py +++ b/Lib/test/test_shlex.py @@ -166,10 +166,10 @@ class ShlexTest(unittest.TestCase): ret.append(tok) tok = lex.get_token() return ret - + def testSplitPosix(self): """Test data splitting with posix parser""" - self.splitTest(self.posix_data, comments=True) + self.splitTest(self.posix_data, comments=True) def testCompat(self): """Test compatibility interface""" diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index c984361..75365fd 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -63,4 +63,3 @@ try: except KeyboardInterrupt: if verbose: print "KeyboardInterrupt (assume the alarm() went off)" - diff --git a/Lib/test/test_stringprep.py b/Lib/test/test_stringprep.py index e7c1ecb..c116adc 100644 --- a/Lib/test/test_stringprep.py +++ b/Lib/test/test_stringprep.py @@ -86,5 +86,3 @@ verify(not in_table_d2(u"\u0040")) # h = sha.sha() # h.update(data) # print p,h.hexdigest() - - diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 705b3ed..4b9ed99 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -58,16 +58,16 @@ class TimeTestCase(unittest.TestCase): from os import environ - # Epoch time of midnight Dec 25th 2002. Never DST in northern + # Epoch time of midnight Dec 25th 2002. Never DST in northern # hemisphere. - xmas2002 = 1040774400.0 + xmas2002 = 1040774400.0 # These formats are correct for 2002, and possibly future years # This format is the 'standard' as documented at: # http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html # They are also documented in the tzset(3) man page on most Unix # systems. - eastern = 'EST+05EDT,M4.1.0,M10.5.0' + eastern = 'EST+05EDT,M4.1.0,M10.5.0' victoria = 'AEST-10AEDT-11,M10.5.0,M3.5.0' utc='UTC+0' @@ -83,7 +83,7 @@ class TimeTestCase(unittest.TestCase): self.failUnlessEqual( time.gmtime(xmas2002), time.localtime(xmas2002) ) - self.failUnlessEqual(time.daylight, 0) + self.failUnlessEqual(time.daylight, 0) self.failUnlessEqual(time.timezone, 0) self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 0) @@ -119,7 +119,7 @@ class TimeTestCase(unittest.TestCase): elif environ.has_key('TZ'): del environ['TZ'] time.tzset() - + def test_main(): test_support.run_unittest(TimeTestCase) diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index 255cea3..23fe1f4 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -6,7 +6,7 @@ import os, glob from test.test_support import verify, TestSkipped, TESTFN_UNICODE from test.test_support import TESTFN_ENCODING try: - TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING) + TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING) except (UnicodeError, TypeError): # Either the file system encoding is None, or the file name # cannot be encoded in the file system encoding. |