Skip to content

Commit

Permalink
feat: officially support Python 3.10 & 3.11 (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Nov 20, 2022
1 parent 1ae0479 commit edecc1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
os:
- ubuntu-latest
- windows-latest
Expand Down
11 changes: 8 additions & 3 deletions tests/test_server.py
@@ -1,6 +1,11 @@
import http.client
import sys
import threading
from test import support

if sys.version_info < (3, 10):
from test.support import threading_cleanup, threading_setup
else:
from test.support.threading_helper import threading_setup, threading_cleanup

import pytest

Expand Down Expand Up @@ -69,7 +74,7 @@ class TestLocalRequestHandler:

@pytest.fixture
def http_server(self):
_threads = support.threading_setup()
_threads = threading_setup()
self.server_started = threading.Event()
thread = ServerWrapperThread(self)
thread.start()
Expand All @@ -78,7 +83,7 @@ def http_server(self):
thread.stop()
# clear assignment to avoid dangling thread
thread = None # type: ignore[assignment]
support.threading_cleanup(*_threads)
threading_cleanup(*_threads)

def request(self, uri, method="GET"):
self.connection = http.client.HTTPConnection(self.host, self.port)
Expand Down

0 comments on commit edecc1c

Please sign in to comment.