Skip to content

Commit

Permalink
Merge pull request #16 from kmaehashi/py312-flake8v7
Browse files Browse the repository at this point in the history
Add CI for Python 3.12 & Flake8 v7
  • Loading branch information
kmaehashi authored Sep 8, 2024
2 parents 2e105a9 + bb66bae commit cdec7ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
flake8: [
'flake8==4.*',
'flake8==5.*',
'flake8==6.*',
'flake8==7.*',
'git+https://github.com/pycqa/flake8.git@main',
]
exclude:
- python: '3.7'
flake8: 'git+https://github.com/pycqa/flake8.git@main'
- python: '3.7'
flake8: 'flake8==7.*'
- python: '3.7'
flake8: 'flake8==6.*'
- python: '3.12'
flake8: 'flake8==4.*'

steps:
- name: Git Checkout
Expand Down
15 changes: 11 additions & 4 deletions tests/test_flake8_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ def test_invalid_token():

results_force = _flake8("invalid_token.py", force=True)
assert len(results_force) == 2
assert results_force[0] == results[0]
assert results_force[1].row == 2
assert results_force[1].code == "E902"
assert "TokenError" in results_force[1].text
if results_force[0] == results[0]:
# Python 3.11 or earlier
token_error = results_force[1]
assert token_error.row == 2
else:
# Python 3.12+
assert results_force[1] == results[0] # SyntaxError
token_error = results_force[0]
assert token_error.row == 1
assert token_error.code == "E902"
assert "TokenError" in token_error.text


def test_invalid_indent():
Expand Down

0 comments on commit cdec7ea

Please sign in to comment.