Skip to content

Commit

Permalink
Switch from pytest to unittest (#33)
Browse files Browse the repository at this point in the history
This saves a dev dependency which sometimes drops support for Python
versions in minor versions.
  • Loading branch information
remcohaszing committed Dec 7, 2023
1 parent 31b07d5 commit a31e277
Show file tree
Hide file tree
Showing 5 changed files with 439 additions and 492 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- run: poetry install
- run: poetry run mypy .

pytest:
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -70,13 +70,20 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: pip install poetry
- run: poetry install
- run: poetry run pytest --cov --cov-report=xml
- run: poetry run coverage run
- run: poetry run coverage report
- run: poetry run coverage lcov
- uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.10' }}

publish:
runs-on: ubuntu-latest
needs: [black, build, flake8, mypy, pytest]
needs:
- black
- build
- flake8
- mypy
- unittest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
Expand All @@ -86,4 +93,4 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
17 changes: 5 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
*.pyc
*.egg-info/
/.coverage
/.eggs/
/.mypy_cache/
/.pytest_cache/
/.tox/
/build/
/CHANGELOG.md
/dist/
/docs/_build
/MANIFEST
.coverage
*.lcov
.mypy_cache/
__pycache__/
_build/
dist/
123 changes: 2 additions & 121 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ python = "^3.7"

[tool.poetry.dev-dependencies]
black = { version = "*", python = ">= 3.8" }
coverage = { version = "*", extras = ["toml"] }
flake8 = { version = "*", python = ">= 3.8" }
flake8-docstrings = { version = "*", python = ">= 3.8" }
flake8-import-order = { version = "*", python = ">= 3.8" }
mypy = { version = "*", python = ">=3.8" }
pytest = "*"
pytest-cov = "*"
types-setuptools = { version = "*", python = ">=3.8" }

[tool.coverage.run]
branch = true
command_line = "-m unittest -v"
source = ["wakeonlan"]

[tool.coverage.report]
Expand Down

0 comments on commit a31e277

Please sign in to comment.