Skip to content

Commit 5044f5f

Browse files
authored
Merge pull request #76 from graingert/3-12
2 parents 7b0f902 + b6ce78c commit 5044f5f

File tree

11 files changed

+41
-25
lines changed

11 files changed

+41
-25
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: [3.7, 3.8, 3.9, "3.10"]
16+
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12-dev]
1717
os: [macOS-latest, ubuntu-latest, windows-latest]
1818

1919
steps:
@@ -53,7 +53,7 @@ jobs:
5353
- name: Download dists for PyPI
5454
uses: actions/download-artifact@v2
5555
with:
56-
name: ubuntu-latest_3.10_dist
56+
name: ubuntu-latest_3.11_dist
5757
path: dist
5858

5959
- name: Display structure of donwloaded files

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.31.0
3+
rev: v3.4.0
44
hooks:
55
- id: pyupgrade
66
args: ["--py37-plus"]
77

88
- repo: https://github.com/psf/black
9-
rev: 22.1.0
9+
rev: 23.3.0
1010
hooks:
1111
- id: black
1212
args: ["--target-version", "py37"]
1313

1414
- repo: https://github.com/pycqa/isort
15-
rev: 5.10.1
15+
rev: 5.12.0
1616
hooks:
1717
- id: isort
1818

1919
- repo: https://github.com/pre-commit/pygrep-hooks
20-
rev: v1.9.0
20+
rev: v1.10.0
2121
hooks:
2222
- id: python-check-blanket-noqa
2323

2424
- repo: https://github.com/pre-commit/pre-commit-hooks
25-
rev: v4.1.0
25+
rev: v4.4.0
2626
hooks:
2727
- id: check-merge-conflict
2828
- id: check-toml
2929
- id: check-yaml
3030
- id: mixed-line-ending
3131

3232
- repo: https://github.com/pre-commit/mirrors-prettier
33-
rev: v2.5.1
33+
rev: v3.0.0-alpha.9-for-vscode
3434
hooks:
3535
- id: prettier
3636
args: [--prose-wrap=always, --print-width=88]
3737

3838
- repo: https://github.com/myint/autoflake
39-
rev: v1.4
39+
rev: v2.1.1
4040
hooks:
4141
- id: autoflake
4242
args:
@@ -46,8 +46,8 @@ repos:
4646
- --remove-duplicate-keys
4747
- --remove-unused-variables
4848

49-
- repo: https://gitlab.com/pycqa/flake8
50-
rev: 3.9.2
49+
- repo: https://github.com/pycqa/flake8
50+
rev: 6.0.0
5151
hooks:
5252
- id: flake8
5353
additional_dependencies: [flake8-2020]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ tox
156156
```
157157

158158
## Changelog
159-
159+
- 2.0.0rc2 (unreleased)
160+
- Add support for Python 3.11 and 3.12, drop dependency on six (#76)
160161
- 2.0.0rc1
161162
- Drop support for Python 2.6, 2.7, 3.4, 3.5 and 3.6 (#68)
162163
- Add support for Python 3.7, 3.8, 3.9 and 3.10 (#68)

pyproject.toml

Whitespace-only changes.

pytest_httpbin/serve.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import os
22
import ssl
33
import threading
4+
from urllib.parse import urljoin
45
from wsgiref.handlers import SimpleHandler
56
from wsgiref.simple_server import WSGIRequestHandler, WSGIServer, make_server
67

7-
from six.moves.urllib.parse import urljoin
8-
98
CERT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "certs")
109

1110

1211
class ServerHandler(SimpleHandler):
13-
1412
server_software = "Pytest-HTTPBIN/0.1.0"
1513
http_version = "1.1"
1614

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ universal=1
88
disable-noqa = True
99
max-line-length = 88
1010
extend-ignore =
11-
E203, # whitespace before : is not PEP8 compliant (& conflicts with black)
11+
# whitespace before : is not PEP8 compliant (& conflicts with black)
12+
E203
1213

1314

1415
[tool:pytest]
1516
addopts = --strict-config --strict-markers
16-
filterwarnings = error
17+
filterwarnings =
18+
error
19+
ignore:ast\.(Str|NameConstant) is deprecated:DeprecationWarning:_pytest
1720
xfail_strict = true

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@
4141
"Programming Language :: Python :: 3.8",
4242
"Programming Language :: Python :: 3.9",
4343
"Programming Language :: Python :: 3.10",
44+
"Programming Language :: Python :: 3.11",
4445
],
4546
# What does your project relate to?
4647
keywords="pytest-httpbin testing pytest httpbin",
4748
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
4849
include_package_data=True, # include files listed in MANIFEST.in
49-
install_requires=["httpbin", "six"],
50-
extras_require={"test": ["requests", "pytest"]},
50+
install_requires=["httpbin"],
51+
extras_require={"test": ["requests", "pytest", "werkzeug<2.1.0"]},
5152
python_requires=">=3.7",
5253
# the following makes a plugin available to pytest
5354
entry_points={

tests/test_httpbin.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import ssl
2+
import sys
13
import unittest
24

3-
import requests
5+
import pytest
6+
import requests.exceptions
47

58
import pytest_httpbin
69

@@ -43,8 +46,17 @@ def test_httpbin_str(httpbin):
4346
assert httpbin + "/foo" == httpbin.url + "/foo"
4447

4548

46-
def test_chunked_encoding(httpbin_both):
47-
assert requests.get(httpbin_both.url + "/stream/20").status_code == 200
49+
def test_chunked_encoding(httpbin):
50+
assert requests.get(httpbin.url + "/stream/20").status_code == 200
51+
52+
53+
@pytest.mark.xfail(
54+
condition=sys.version_info < (3, 8) and ssl.OPENSSL_VERSION_INFO >= (3, 0, 0),
55+
reason="fails on python3.7 openssl 3+",
56+
raises=requests.exceptions.SSLError,
57+
)
58+
def test_chunked_encoding_secure(httpbin_secure):
59+
assert requests.get(httpbin_secure.url + "/stream/20").status_code == 200
4860

4961

5062
@pytest_httpbin.use_class_based_httpbin

tests/test_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ def test_redirect_location_is_https_for_secure_server(httpbin_secure):
121121
)
122122
assert response.status_code == 302
123123
assert response.headers.get("Location")
124-
assert response.headers["Location"].startswith("https://")
124+
assert response.headers["Location"] == "/html"

tests/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
def get_raw_http_response(host, port, path):
5-
65
CRLF = b"\r\n"
76

87
request = [

0 commit comments

Comments
 (0)