Skip to content

Commit e0a2ec8

Browse files
committed
remove unnecessary trailing 'u' characters in strings
1 parent 3049a2d commit e0a2ec8

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lib/matplotlib/tests/test_ticker.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -552,23 +552,23 @@ class TestEngFormatter(object):
552552
# (input, expected) where ''expected'' corresponds to the outputs
553553
# respectively returned when (places=None, places=0, places=2)
554554
raw_format_data = [
555-
(-1234.56789, (u'-1.23457 k', u'-1 k', u'-1.23 k')),
556-
(-1.23456789, (u'-1.23457', u'-1', u'-1.23')),
557-
(-0.123456789, (u'-123.457 m', u'-123 m', u'-123.46 m')),
558-
(-0.00123456789, (u'-1.23457 m', u'-1 m', u'-1.23 m')),
559-
(-0.0, (u'0', u'0', u'0.00')),
560-
(-0, (u'0', u'0', u'0.00')),
561-
(0, (u'0', u'0', u'0.00')),
562-
(1.23456789e-6, (u'1.23457 \u03bc', u'1 \u03bc', u'1.23 \u03bc')),
563-
(0.123456789, (u'123.457 m', u'123 m', u'123.46 m')),
564-
(0.1, (u'100 m', u'100 m', u'100.00 m')),
565-
(1, (u'1', u'1', u'1.00')),
566-
(1.23456789, (u'1.23457', u'1', u'1.23')),
567-
(999.9, (u'999.9', u'999', u'999.90')),
568-
(1000, (u'1 k', u'1 k', u'1.00 k')),
569-
(1001, (u'1.001 k', u'1 k', u'1.00 k')),
570-
(100001, (u'100.001 k', u'100 k', u'100.00 k')),
571-
(987654.321, (u'987.654 k', u'987 k', u'987.65 k'))
555+
(-1234.56789, ('-1.23457 k', '-1 k', '-1.23 k')),
556+
(-1.23456789, ('-1.23457', '-1', '-1.23')),
557+
(-0.123456789, ('-123.457 m', '-123 m', '-123.46 m')),
558+
(-0.00123456789, ('-1.23457 m', '-1 m', '-1.23 m')),
559+
(-0.0, ('0', '0', '0.00')),
560+
(-0, ('0', '0', '0.00')),
561+
(0, ('0', '0', '0.00')),
562+
(1.23456789e-6, ('1.23457 \u03bc', '1 \u03bc', '1.23 \u03bc')),
563+
(0.123456789, ('123.457 m', '123 m', '123.46 m')),
564+
(0.1, ('100 m', '100 m', '100.00 m')),
565+
(1, ('1', '1', '1.00')),
566+
(1.23456789, ('1.23457', '1', '1.23')),
567+
(999.9, ('999.9', '999', '999.90')),
568+
(1000, ('1 k', '1 k', '1.00 k')),
569+
(1001, ('1.001 k', '1 k', '1.00 k')),
570+
(100001, ('100.001 k', '100 k', '100.00 k')),
571+
(987654.321, ('987.654 k', '987 k', '987.65 k'))
572572
]
573573

574574
@pytest.mark.parametrize('input, expected', raw_format_data)
@@ -582,8 +582,8 @@ def test_params(self, input, expected):
582582
3. with neihter a unit nor a space separator.
583583
"""
584584

585-
UNIT = u's' # seconds
586-
DIGITS = u'0123456789' # %timeit showed 10-20% faster search than set
585+
UNIT = 's' # seconds
586+
DIGITS = '0123456789' # %timeit showed 10-20% faster search than set
587587

588588
# Case 0: unit='' (default) and sep=' ' (default).
589589
# 'expected' already corresponds to this reference case.
@@ -599,7 +599,7 @@ def test_params(self, input, expected):
599599
# Case 1: unit=UNIT and sep=' ' (default).
600600
# Append a unit symbol to the reference case.
601601
# Beware of the values in [1, 1000), where there is no prefix!
602-
exp_outputs = (_s + u" " + UNIT if _s[-1] in DIGITS # case w/o prefix
602+
exp_outputs = (_s + " " + UNIT if _s[-1] in DIGITS # case w/o prefix
603603
else _s + UNIT for _s in expected)
604604
formatters = (
605605
mticker.EngFormatter(unit=UNIT), # places=None (default)

0 commit comments

Comments
 (0)