diff options
author | Eric V. Smith <eric@trueblade.com> | 2016-09-11 18:58:20 -0400 |
---|---|---|
committer | Eric V. Smith <eric@trueblade.com> | 2016-09-11 18:58:20 -0400 |
commit | 09835dcdbb8bb9c5f355ed55d2fa8c0d140ee7ee (patch) | |
tree | 3fb91f7d4beed603624683ce4ed2507726fb5f29 /Lib/test/test_fstring.py | |
parent | 13a6d2834a3e9920bd8f07700bea0919408035bc (diff) | |
download | cpython-09835dcdbb8bb9c5f355ed55d2fa8c0d140ee7ee.tar.gz cpython-09835dcdbb8bb9c5f355ed55d2fa8c0d140ee7ee.zip |
Make an f-string error message more exact and consistent.
Diffstat (limited to 'Lib/test/test_fstring.py')
-rw-r--r-- | Lib/test/test_fstring.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index e61f63594fa..655819425d1 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -182,9 +182,10 @@ f'{a * x()}'""" self.assertEqual(f'{"#"}', '#') self.assertEqual(f'{d["#"]}', 'hash') - self.assertAllRaise(SyntaxError, "f-string cannot include '#'", + self.assertAllRaise(SyntaxError, "f-string expression part cannot include '#'", ["f'{1#}'", # error because the expression becomes "(1#)" "f'{3(#)}'", + "f'{#}'", ]) def test_many_expressions(self): |