Skip to content

Commit

Permalink
fix: tox config
Browse files Browse the repository at this point in the history
  • Loading branch information
sysid committed Apr 5, 2024
1 parent 47fc236 commit 7dc03e1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,23 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions pytest black coverage requests pytest-asyncio
- name: Run tox
pip install tox tox-gh-actions \
pytest \
pytest-cov \
pytest-asyncio \
black \
coverage \
requests \
httpx \
asgi_lifespan \
psutil \
uvicorn \
starlette \
fastapi
- name: Run tests
run: |
make tox
make test-unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ TESTING: ## ############################################################
test: ## run tests
python -m pytest -ra --junitxml=report.xml --cov-config=pyproject.toml --cov-report=xml --cov-report term --cov=$(pkg_src) tests/

.PHONY: test-unit
test-unit: ## run all tests except "integration" marked
RUN_ENV=local python -m pytest -m "not (integration or e2e)" --cov-config=pyproject.toml --cov-report=html --cov-report=term --cov=$(pkg_src) tests

.PHONY: tox
tox: ## Run tox
tox
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Source = "https://github.com/sysid/sse-starlette"
[project.optional-dependencies]
examples = ["fastapi"]

[tool.pytest.ini_options]
markers = [
"integration: marks tests as integration tests",
"e2e: marks tests as e2e tests, not to be run in CICD"
]
asyncio_mode = "auto"
#addopts = "--cov=my_package --cov-report=term-missing"

[tool.bumpversion]
current_version = "2.0.0"
commit = true
Expand Down Expand Up @@ -89,12 +97,6 @@ dev = [
"psutil",
"black>=23.11.0",
]
[tool.pytest.ini_options]
markers = [
"integration: marks tests as integration tests",
]
asyncio_mode = "auto"
#addopts = "--cov=my_package --cov-report=term-missing"

[tool.isort]
multi_line_output = 3
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_multiple_consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ async def make_arequest(url, expected_lines=2):


@pytest.mark.skipif(os.name == "nt", reason="Skip on Windows")
@pytest.mark.e2e
@pytest.mark.parametrize(
("server_command", "expected_lines"),
[
Expand Down

0 comments on commit 7dc03e1

Please sign in to comment.