Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
branch = True
source = packet

[report]
exclude_lines =
pragma: no cover
def __repr__
if .debug:
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True
omit =
.tox/*
test/*
setup.py

24 changes: 20 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
python-version:
- 3.8
- '3.10'

steps:
- uses: actions/checkout@v2
Expand All @@ -30,19 +30,35 @@ jobs:
matrix:
python-version:
- 2.7
- 3.6
- 3.7
- 3.8
- 3.9
- '3.10'

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- id: test
- name: Install Dependencies
run: |
python -m pip install --upgrade setuptools pip wheel
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox
find . # TODO: remove this
# - name: Upload coverage.xml
# if: ${{ matrix.python-version == '3.10' }}
# uses: actions/upload-artifact@v2
# with:
# name: tox-gh-actions-coverage
# path: coverage.xml
# if-no-files-found: error
- uses: codecov/codecov-action@v2
if: ${{ matrix.python-version == '3.10' }}
with:
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
unittest_*.xml
*,cover
.hypothesis/

Expand Down
8 changes: 0 additions & 8 deletions test/.coveragerc

This file was deleted.

31 changes: 26 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,46 @@

[tox]

envlist = py27,py36,py37,py38,py39
envlist = py27,py38,py39,py310
skip_missing_interpreters=True

[tool:pytest]
testpaths = test
# addopts =

[gh-actions]
python =
2.7: py27
3.6: py36
3.7: py37
3.8: py38, mypy
3.8: py38
3.9: py39
3.10: py310, mypy

[testenv]
usedevelop=True
setenv =
PACKET_AUTH_TOKEN = {env:PACKET_AUTH_TOKEN:}

deps =
pytest
coverage
pytest-cov
requests_mock

commands=
py.test -v --cov {envsitepackagesdir}/packet --cov-report=term-missing test
py.test --cov-append --cov-report=term-missing --cov packet --cov-report xml:{envdir}/../../coverage.xml --junitxml=unittest_{envname}.xml {posargs:-vv}

depends =
{py39}: clean
report: py39

[testenv:report]
deps = coverage
skip_install = true
commands =
coverage report
coverage xml:coverage.xml

[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase