Skip to content

Commit

Permalink
Run tests in CI using pytest-xdist, refs #1289
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Apr 3, 2021
1 parent 87b583a commit d63fc61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jobs:
pip install -e '.[test]'
- name: Run tests
run: |
pytest
pytest -n auto -m "not serial"
pytest -m "serial"
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ filterwarnings=
ignore:Using or importing the ABCs::bs4.element
# Python 3.7 PendingDeprecationWarning: Task.current_task()
ignore:.*current_task.*:PendingDeprecationWarning
markers =
serial: tests to avoid using with pytest-xdist
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get_version():
"docs": ["sphinx_rtd_theme", "sphinx-autobuild"],
"test": [
"pytest>=5.2.2,<6.3.0",
"pytest-xdist>=2.2.1,<2.3",
"pytest-asyncio>=0.10,<0.15",
"beautifulsoup4>=4.8.1,<4.10.0",
"black==20.8b1",
Expand Down
3 changes: 3 additions & 0 deletions tests/test_cli_serve_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import httpx
import pytest


@pytest.mark.serial
def test_serve_localhost_http(ds_localhost_http_server):
response = httpx.get("http://localhost:8041/_memory.json")
assert {
Expand All @@ -10,6 +12,7 @@ def test_serve_localhost_http(ds_localhost_http_server):
}.items() <= response.json().items()


@pytest.mark.serial
def test_serve_localhost_https(ds_localhost_https_server):
_, client_cert = ds_localhost_https_server
response = httpx.get("https://localhost:8042/_memory.json", verify=client_cert)
Expand Down

0 comments on commit d63fc61

Please sign in to comment.