summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_future.py
diff options
context:
space:
mode:
authorEric V. Smith <ericvsmith@users.noreply.github.com>2019-05-08 20:28:48 (GMT)
committerGitHub <noreply@github.com>2019-05-08 20:28:48 (GMT)
commit9a4135e939bc223f592045a38e0f927ba170da32 (patch)
treede347c6f2df801dc98b36ab5084dada335741517 /Lib/test/test_future.py
parent65d98d0f53f558d7c799098da0abf376068c15fd (diff)
downloadcpython-9a4135e939bc223f592045a38e0f927ba170da32.zip
cpython-9a4135e939bc223f592045a38e0f927ba170da32.tar.gz
cpython-9a4135e939bc223f592045a38e0f927ba170da32.tar.bz2
bpo-36817: Add f-string debugging using '='. (GH-13123)
If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression.
Diffstat (limited to 'Lib/test/test_future.py')
-rw-r--r--Lib/test/test_future.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index c60a016..38de3df 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -255,6 +255,15 @@ class AnnotationsFutureTestCase(unittest.TestCase):
eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'")
eq("f'{(lambda x: x)}'")
eq("f'{(None if a else lambda x: x)}'")
+ eq("f'{x}'")
+ eq("f'{x!r}'")
+ eq("f'{x!a}'")
+ eq("f'{x=!r}'")
+ eq("f'{x=:}'")
+ eq("f'{x=:.2f}'")
+ eq("f'{x=!r}'")
+ eq("f'{x=!a}'")
+ eq("f'{x=!s:*^20}'")
eq('(yield from outside_of_generator)')
eq('(yield)')
eq('(yield a + b)')