Skip to content

Commit b47afc4

Browse files
committed
fix regressions in unit tests in Python 3.12+
1 parent 3994e16 commit b47afc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

unpythonic/syntax/tests/test_letdo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,13 @@ def test3():
385385

386386
@dlet(x << "the env x")
387387
def test4():
388-
nonlocal x
388+
nonlocal x # noqa: F824, Python 3.12+ complain about this; just testing our let construct; it's correct that there's no local `x` as per Python's normal scoping rules.
389389
return x
390390
test[test4() == "the nonlocal x"]
391391

392392
@dlet(x << "the env x")
393393
def test5():
394-
global x
394+
global x # noqa: F824, Python 3.12+ complain about this; just testing our let construct; it's correct that there's no local `x` as per Python's normal scoping rules.
395395
return x
396396
test[test5() == "the global x"]
397397

unpythonic/syntax/tests/test_scopeanalyzer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def f3():
179179
with q as getlexvars_fdef:
180180
y = 21
181181
def myfunc(x, *args, kwonlyarg, **kwargs):
182-
nonlocal y # not really needed here, except for exercising the analyzer.
183-
global g
182+
nonlocal y # noqa: F824, for Python 3.12+; just testing our scope analyzer; it's correct that there's no local `y`. Also, not really needed here, except for exercising the analyzer.
183+
global g # noqa: F824, Python 3.12+ complain about this; just testing our scope analyzer; it's correct that there's no local `g`.
184184
def inner(blah):
185185
abc = 123 # noqa: F841
186186
z = 2 * y # noqa: F841

0 commit comments

Comments
 (0)