Skip to content

Commit 12b3173

Browse files
authored
Merge pull request #173 from nicoddemus/drop-py37-add-py310-plus
Drop Python 3.7, add Python 3.10, 3.11, and 3.12
2 parents 638cb40 + 2f129c7 commit 12b3173

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python: ["3.7", "3.8", "3.9"]
34+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
3535
os: [ubuntu-latest, windows-latest]
3636

3737
steps:

docs/changelog.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
Changelog
44
=========
55

6+
UNRELEASED
7+
----------
8+
9+
* Added support for Python 3.10, 3.11, and 3.12.
10+
* Dropped support for EOL Python 3.7.
11+
612
1.3.0 (2023-10-23)
713
------------------
814

9-
- Fix compatibility with ``Flask 3.0`` -- the consequence is that the deprecated and incompatible ``request_ctx`` has been removed.
15+
- Fixed compatibility with ``Flask 3.0`` -- the consequence is that the deprecated and incompatible ``request_ctx`` has been removed.
1016

1117
1.2.1
1218
------------------

setup.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ classifiers=
1919
Environment :: Web Environment
2020
Intended Audience :: Developers
2121
Operating System :: OS Independent
22-
Programming Language :: Python :: 3.7
2322
Programming Language :: Python :: 3.8
2423
Programming Language :: Python :: 3.9
24+
Programming Language :: Python :: 3.10
25+
Programming Language :: Python :: 3.11
26+
Programming Language :: Python :: 3.12
2527
License :: OSI Approved :: MIT License
2628
Topic :: Software Development :: Testing
2729
Development Status :: 5 - Production/Stable
@@ -30,7 +32,7 @@ classifiers=
3032
[options]
3133
packages = pytest_flask
3234
zip_safe = False
33-
python_requires = >= 3.7
35+
python_requires = >= 3.8
3436
setup_requires = setuptools_scm
3537
package_dir =
3638
=src

setup.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
#!/usr/bin/env python
2-
import os
2+
from pathlib import Path
33

44
from setuptools import setup
55

6-
7-
def read(*parts):
8-
"""Reads the content of the file located at path created from *parts*."""
9-
try:
10-
return open(os.path.join(*parts), "r", encoding="utf-8").read()
11-
except OSError:
12-
return ""
13-
14-
156
tests_require = []
16-
requirements = read("requirements", "main.txt").splitlines()
7+
requirements = Path("requirements/main.txt").read_text(encoding="UTF-8").splitlines()
178
extras_require = {
18-
"docs": read("requirements", "docs.txt").splitlines(),
19-
"tests": tests_require,
9+
"docs": Path("requirements/docs.txt").read_text(encoding="UTF-8").splitlines(),
10+
"tests": [tests_require],
2011
}
2112

2213
setup(

src/pytest_flask/live_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _is_ready(self):
6161
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
6262
try:
6363
sock.connect((self.host, self.port))
64-
except socket.error:
64+
except OSError:
6565
ret = False
6666
else:
6767
ret = True

src/pytest_flask/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def pytest_assertrepr_compare(op, left, right):
3737
left.status_code,
3838
right,
3939
),
40-
"Response status: {}".format(left.status),
40+
f"Response status: {left.status}",
4141
]
4242
return None
4343

tests/test_live_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TestLiveServer:
1111
def test_init(self, live_server):
1212
assert live_server.port
1313
assert live_server.host == "localhost"
14-
assert live_server.url() == "http://localhost:{0}".format(live_server.port)
14+
assert live_server.url() == f"http://localhost:{live_server.port}"
1515

1616
def test_server_is_alive(self, live_server):
1717
assert live_server._process

0 commit comments

Comments
 (0)