Skip to content

Commit 6f0f574

Browse files
committed
foo-> bar in some test files, replace a couple instances of flake8_5 I missed, add py313 support now that hypothesmith is updated
1 parent 41539a0 commit 6f0f574

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
python-version: ['3.9', '3.10', '3.11', '3.12']
30+
python-version: ['3.9', '3.10', '3.11', '3.12', 3.13-dev]
3131
fail-fast: false
3232
steps:
3333
- uses: actions/checkout@v4

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def local_file(name: str) -> Path:
4242
"Programming Language :: Python :: 3.10",
4343
"Programming Language :: Python :: 3.11",
4444
"Programming Language :: Python :: 3.12",
45+
"Programming Language :: Python :: 3.13",
4546
],
4647
long_description=(
4748
local_file("README.md").open().read()

tests/autofix_files/trio91x_autofix.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ async def foo_yield(): # TRIO911: 0, "exit", Statement("yield", lineno+2)
3838

3939

4040
async def foo_if():
41-
if foo():
41+
if bar():
4242
await trio.lowlevel.checkpoint()
4343
return # TRIO910: 8, "return", Statement("function definition", lineno-2)
44-
elif foo():
44+
elif bar():
4545
await trio.lowlevel.checkpoint()
4646
return # TRIO910: 8, "return", Statement("function definition", lineno-4)
4747
else:
@@ -66,18 +66,18 @@ async def foo_while2():
6666
async def foo_while3():
6767
await foo()
6868
while True:
69-
if foo():
69+
if bar():
7070
return
7171
await foo()
7272

7373

7474
# check that multiple checkpoints don't get inserted
7575
async def foo_while4():
7676
while True:
77-
if foo():
77+
if bar():
7878
await trio.lowlevel.checkpoint()
7979
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno+2) # TRIO911: 12, "yield", Statement("function definition", lineno-3)
80-
if foo():
80+
if bar():
8181
await trio.lowlevel.checkpoint()
8282
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno-2) # TRIO911: 12, "yield", Statement("function definition", lineno-5) # TRIO911: 12, "yield", Statement("yield", lineno-2)
8383
# this warns about the yield on lineno-2 twice, since it can arrive here from it in two different ways
@@ -102,7 +102,7 @@ async def foo_while_nested_func():
102102
yield # TRIO911: 8, "yield", Statement("function definition", lineno-2) # TRIO911: 8, "yield", Statement("yield", lineno)
103103

104104
async def bar():
105-
while foo():
105+
while bar():
106106
...
107107
await foo()
108108

@@ -116,10 +116,10 @@ async def async_func(): ...
116116
...
117117
except:
118118
...
119-
if foo() and foo():
119+
if bar() and bar():
120120
...
121121
while ...:
122-
if foo():
122+
if bar():
123123
continue
124124
break
125125
[... for i in range(5)]

tests/autofix_files/trio91x_autofix.py.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929

3030

3131
async def foo_if():
32-
if foo():
32+
if bar():
3333
+ await trio.lowlevel.checkpoint()
3434
return # TRIO910: 8, "return", Statement("function definition", lineno-2)
35-
elif foo():
35+
elif bar():
3636
+ await trio.lowlevel.checkpoint()
3737
return # TRIO910: 8, "return", Statement("function definition", lineno-4)
3838
else:
@@ -50,10 +50,10 @@
5050
@@ x,8 x,10 @@
5151
async def foo_while4():
5252
while True:
53-
if foo():
53+
if bar():
5454
+ await trio.lowlevel.checkpoint()
5555
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno+2) # TRIO911: 12, "yield", Statement("function definition", lineno-3)
56-
if foo():
56+
if bar():
5757
+ await trio.lowlevel.checkpoint()
5858
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno-2) # TRIO911: 12, "yield", Statement("function definition", lineno-5) # TRIO911: 12, "yield", Statement("yield", lineno-2)
5959
# this warns about the yield on lineno-2 twice, since it can arrive here from it in two different ways

tests/eval_files/trio91x_autofix.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ async def foo_yield(): # TRIO911: 0, "exit", Statement("yield", lineno+2)
3333

3434

3535
async def foo_if():
36-
if foo():
36+
if bar():
3737
return # TRIO910: 8, "return", Statement("function definition", lineno-2)
38-
elif foo():
38+
elif bar():
3939
return # TRIO910: 8, "return", Statement("function definition", lineno-4)
4040
else:
4141
return # TRIO910: 8, "return", Statement("function definition", lineno-6)
@@ -57,17 +57,17 @@ async def foo_while2():
5757
async def foo_while3():
5858
await foo()
5959
while True:
60-
if foo():
60+
if bar():
6161
return
6262
await foo()
6363

6464

6565
# check that multiple checkpoints don't get inserted
6666
async def foo_while4():
6767
while True:
68-
if foo():
68+
if bar():
6969
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno+2) # TRIO911: 12, "yield", Statement("function definition", lineno-3)
70-
if foo():
70+
if bar():
7171
yield # TRIO911: 12, "yield", Statement("yield", lineno) # TRIO911: 12, "yield", Statement("yield", lineno-2) # TRIO911: 12, "yield", Statement("function definition", lineno-5) # TRIO911: 12, "yield", Statement("yield", lineno-2)
7272
# this warns about the yield on lineno-2 twice, since it can arrive here from it in two different ways
7373

@@ -87,7 +87,7 @@ async def foo_while_nested_func():
8787
yield # TRIO911: 8, "yield", Statement("function definition", lineno-2) # TRIO911: 8, "yield", Statement("yield", lineno)
8888

8989
async def bar():
90-
while foo():
90+
while bar():
9191
...
9292
await foo()
9393

@@ -101,10 +101,10 @@ async def async_func(): ...
101101
...
102102
except:
103103
...
104-
if foo() and foo():
104+
if bar() and bar():
105105
...
106106
while ...:
107-
if foo():
107+
if bar():
108108
continue
109109
break
110110
[... for i in range(5)]

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# The test environment and commands
22
[tox]
33
# default environments to run without `-e`
4-
envlist = py{39,310,311,312}-{flake8_5,flake8_6}
4+
envlist = py{39,310,311,312,313}-{flake8_6,flake8_7}
55

66
# create a default testenv, whose behaviour will depend on the name it's called with.
7-
# for CI you can call with `-e flake8_5,flake8_6` and let the CI handle python version
7+
# for CI you can call with `-e flake8_6,flake8_7` and let the CI handle python version
88
[testenv]
99
description = Runs pytest, optionally with posargs
1010
deps =
@@ -14,7 +14,8 @@ deps =
1414
pytest-cov
1515
pytest-xdist
1616
hypothesis
17-
hypothesmith
17+
# 0.3.3 adds py313 support
18+
hypothesmith >= 0.3.3
1819
trio
1920
commands =
2021
pytest {posargs:-n auto}

0 commit comments

Comments
 (0)