Skip to content

Commit

Permalink
log mock server
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgross committed Jan 3, 2025
1 parent c1bcbaa commit 36f981d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pcloud-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest-rerunfailures==15.0 pytest-cov==6.0.0 pytest-timeout==2.3.1
pip install -e ".[test]"
playwright install
- name: Lint with flake8
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ dependencies = [
test = [
"pytest==8.3.4",
"pytest-sugar==1.0.0",
"pytest-timeout==2.3.1",
"pytest-cov==6.0.0",
"pytest-rerunfailures==15.0",
"wheel==0.45.1",
"flake8==7.1.1",
"fs==2.4.16",
Expand Down
12 changes: 9 additions & 3 deletions src/pcloud/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import logging
import pytest

from pcloud.tests.server import MockHandler
from pcloud.tests.server import MockServer
import pytest

from threading import Thread

log = logging.getLogger("pcloud")
log.setLevel(logging.INFO)

PORT = 5023


Expand All @@ -11,9 +17,9 @@ def start_mock_server():
"""Start a mock server on port 5023"""
httpd = MockServer(("", PORT), MockHandler)
httpd_thread = Thread(target=httpd.serve_forever, daemon=True)
log.info(f"Start mock server at port {PORT}")
httpd_thread.start()
print("start")
yield start_mock_server
print("teardown")
log.info(f"Teardown mock server from port {PORT}")
httpd.shutdown()
httpd_thread.join()

0 comments on commit 36f981d

Please sign in to comment.