diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-09-19 12:01:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-19 12:01:59 (GMT) |
commit | 94c95d42a3b74729ee775f583fb7951f05d16c77 (patch) | |
tree | 1914282c26600522e7682e94becc198a70cfd0a0 /Lib/test/test_future_stmt/nested_scope.py | |
parent | 59f32a785fbce76a0fa02fe6d671813057714a0a (diff) | |
download | cpython-94c95d42a3b74729ee775f583fb7951f05d16c77.zip cpython-94c95d42a3b74729ee775f583fb7951f05d16c77.tar.gz cpython-94c95d42a3b74729ee775f583fb7951f05d16c77.tar.bz2 |
gh-109485: Further improve `test_future_stmt` tests (#109486)
Add assertSyntaxError() which run tests with an additional docstring
and without docstring, and checks for the error message.
Diffstat (limited to 'Lib/test/test_future_stmt/nested_scope.py')
-rw-r--r-- | Lib/test/test_future_stmt/nested_scope.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_future_stmt/nested_scope.py b/Lib/test/test_future_stmt/nested_scope.py new file mode 100644 index 0000000..3d7fc86 --- /dev/null +++ b/Lib/test/test_future_stmt/nested_scope.py @@ -0,0 +1,10 @@ +"""This is a test""" + +from __future__ import nested_scopes; import site + +def f(x): + def g(y): + return x + y + return g + +result = f(2)(4) |