Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
Expand Down
12 changes: 4 additions & 8 deletions pytestify/fixes/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ast
import re
import sys
from dataclasses import dataclass, field
from tokenize import TokenError
from typing import NamedTuple
Expand Down Expand Up @@ -169,12 +168,7 @@ def visit_Call(self, call: ast.Call) -> None:
# still rewrite it, but without specially handling it
continue

const = keyword.value
if sys.version_info >= (3, 8):
kwargs[arg] = const.value # type: ignore
else:
# Prior to Python 3.8, const is actually a ast.Num object
kwargs[arg] = const.n # type: ignore
kwargs[arg] = keyword.value.value
end_line = close_paren.line
self.calls.append(
Call(
Expand All @@ -185,7 +179,9 @@ def visit_Call(self, call: ast.Call) -> None:
comments=comments,
commas=commas,
keywords=call.keywords,
**kwargs
# The below line triggers a mypy issue,
# see https://github.com/python/mypy/issues/5382.
**kwargs # type: ignore
),
)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ project_urls =
packages = find:
install_requires =
tokenize-rt>=4.0.0
python_requires = >=3.7
python_requires = >=3.8

[options.packages.find]
exclude =
Expand Down