summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tools
diff options
context:
space:
mode:
authorChih-Hsuan Yen <yan12125@gmail.com>2019-05-26 17:08:20 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-26 17:08:19 (GMT)
commitaaf47caf35984e614d93bd8bea5227df55e0e3e6 (patch)
tree14f42690fe8234b67dac4ced92dbaff183865375 /Lib/test/test_tools
parent91f4380cedbae32b49adbea2518014a5624c6523 (diff)
downloadcpython-aaf47caf35984e614d93bd8bea5227df55e0e3e6.zip
cpython-aaf47caf35984e614d93bd8bea5227df55e0e3e6.tar.gz
cpython-aaf47caf35984e614d93bd8bea5227df55e0e3e6.tar.bz2
bpo-37053: handle strings like u"bar" correctly in Tools/parser/unparse.py (GH-13583)
Constant.kind is added in https://bugs.python.org/issue36280. Current possible values for Constant.kind are "u" or None. For r'bar' and b'bar', Constant.kind value is None, so there's no need for special handling. https://bugs.python.org/issue37053
Diffstat (limited to 'Lib/test/test_tools')
-rw-r--r--Lib/test/test_tools/test_unparse.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_tools/test_unparse.py b/Lib/test/test_tools/test_unparse.py
index f3386f5..a958ebb 100644
--- a/Lib/test/test_tools/test_unparse.py
+++ b/Lib/test/test_tools/test_unparse.py
@@ -139,6 +139,11 @@ class UnparseTestCase(ASTTestCase):
self.check_roundtrip(r"""f'{f"{0}"*3}'""")
self.check_roundtrip(r"""f'{f"{y}"*3}'""")
+ def test_strings(self):
+ self.check_roundtrip("u'foo'")
+ self.check_roundtrip("r'foo'")
+ self.check_roundtrip("b'foo'")
+
def test_del_statement(self):
self.check_roundtrip("del x, y, z")