Skip to content

Commit

Permalink
ci: Test using python 3.9 and 3.10 (#6)
Browse files Browse the repository at this point in the history
* ci: Test using python 3.9 and 3.10

* ci: Update black

* ci: Use profile black

* ci: Update pytest fix assertion error in python 3.10
  • Loading branch information
boatx committed Sep 2, 2023
1 parent 355f931 commit 4357df8
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8']
python-version: ['3.7', '3.8', '3.9', '3.10']
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ To test server you can use simple JavaScript client from `client/client.html`.

## Requirements

* python => 3.6
* python => 3.7
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import nox
from nox.sessions import Session

PYTHON_VERSIONS = ("3.8", "3.7")
PYTHON_VERSIONS = ("3.10", "3.9", "3.8", "3.7")
LOCATIONS = ("noxfile.py", "tests", "sockit")

nox.options.sessions = ("lint", "mypy", "pytype", "tests")
Expand Down
264 changes: 100 additions & 164 deletions poetry.lock

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ authors = ["boatx <1446337+boatx@users.noreply.github.com>"]
python = "^3.7"

[tool.poetry.dev-dependencies]
pytest = "^5.4.3"
pytest = "^6.2.5"
coverage = {extras = ["toml"], version = "^5.2"}
pytest-cov = "^2.10.0"
black = "^19.10b0"
black = "^23.3.0"
flake8 = "^5.0.0"
flake8-bandit = "^4.1.1"
flake8-black = "^0.2.0"
Expand All @@ -36,10 +36,7 @@ show_missing = true
known_first_party = ["sockit", "tests"]
default_section = "THIRDPARTY"
# black compatible settings
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
profile = "black"
line_length = 79

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_generate_handshake_response(
mock_generate_sec_server_accept_key: Mock,
http_request: HTTPRequest,
) -> None:

assert generate_handshake_response(http_request) == (
b"HTTP/1.1 101 Switching Protocols\r\n"
b"Upgrade: websocket\r\n"
Expand All @@ -159,7 +158,8 @@ def test_generate_handshake_response(
)

def test_generate_handshake_response_raise_key_error(
self, http_request: HTTPRequest,
self,
http_request: HTTPRequest,
) -> None:
http_request.headers = HTTPMessage()
with pytest.raises(InvalidSecWebsocketKey):
Expand Down
1 change: 0 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def test_init_default_params(self) -> None:
assert http_request.raw_requestline == b""

def test_init_call_parse_request(self) -> None:

with patch.object(HTTPRequest, "parse_request") as mock_parse_request:
HTTPRequest()
mock_parse_request.assert_called_once_with()

0 comments on commit 4357df8

Please sign in to comment.