diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2013-08-31 19:48:51 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2013-08-31 19:48:51 (GMT) |
commit | 13bdfa7a7fba377af278819e8ab96a38cfe92ecf (patch) | |
tree | 93a739e6880c64f2ac689652bcab9060924975ca | |
parent | a41213726b56df97e63572d038ffb451c461657c (diff) | |
download | cpython-13bdfa7a7fba377af278819e8ab96a38cfe92ecf.zip cpython-13bdfa7a7fba377af278819e8ab96a38cfe92ecf.tar.gz cpython-13bdfa7a7fba377af278819e8ab96a38cfe92ecf.tar.bz2 |
Issue #18780: code cleanup.
-rw-r--r-- | Lib/test/test_unicode.py | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index daab79d..c8fa7f3 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1134,42 +1134,27 @@ class UnicodeTest(string_tests.CommonTest, class Str(str, enum.Enum): ABC = 'abc' # Testing Unicode formatting strings... - self.assertEqual( - "%s, %s" % (Str.ABC, Str.ABC), - 'Str.ABC, Str.ABC', - ) - self.assertEqual( - "%s, %s, %d, %i, %u, %f, %5.2f" % - (Str.ABC, Str.ABC, - Int.IDES, Int.IDES, Int.IDES, - Float.PI, Float.PI), - 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14') + self.assertEqual("%s, %s" % (Str.ABC, Str.ABC), + 'Str.ABC, Str.ABC') + self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" % + (Str.ABC, Str.ABC, + Int.IDES, Int.IDES, Int.IDES, + Float.PI, Float.PI), + 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14') # formatting jobs delegated from the string implementation: - self.assertEqual( - '...%(foo)s...' % {'foo':Str.ABC}, - '...Str.ABC...', - ) - self.assertEqual( - '...%(foo)s...' % {'foo':Int.IDES}, - '...Int.IDES...', - ) - self.assertEqual( - '...%(foo)i...' % {'foo':Int.IDES}, - '...15...', - ) - self.assertEqual( - '...%(foo)d...' % {'foo':Int.IDES}, - '...15...', - ) - self.assertEqual( - '...%(foo)u...' % {'foo':Int.IDES, 'def':Float.PI}, - '...15...', - ) - self.assertEqual( - '...%(foo)f...' % {'foo':Float.PI,'def':123}, - '...3.141593...', - ) + self.assertEqual('...%(foo)s...' % {'foo':Str.ABC}, + '...Str.ABC...') + self.assertEqual('...%(foo)s...' % {'foo':Int.IDES}, + '...Int.IDES...') + self.assertEqual('...%(foo)i...' % {'foo':Int.IDES}, + '...15...') + self.assertEqual('...%(foo)d...' % {'foo':Int.IDES}, + '...15...') + self.assertEqual('...%(foo)u...' % {'foo':Int.IDES, 'def':Float.PI}, + '...15...') + self.assertEqual('...%(foo)f...' % {'foo':Float.PI,'def':123}, + '...3.141593...') @support.cpython_only def test_formatting_huge_precision(self): |