Skip to content

Commit

Permalink
Merge pull request #168 from larsks/feature/pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
larsks authored Jul 22, 2024
2 parents 92922ca + ff2da46 commit 0626590
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
branch = True

[report]
ignore_errors = True
omit =
esi_leap/tests/*

[html]
directory = coverage_html_report
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: esi-leap
name: Unit tests

on: [push, pull_request]

jobs:
build:
run-unit-tests:

runs-on: ubuntu-20.04
strategy:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__/
.tox/
*.swp
etc/esi-leap/esi-leap.conf.sample
.coverage/
3 changes: 0 additions & 3 deletions .stestr.conf

This file was deleted.

5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
# Suppress DeprecationWarnings in third party modules
filterwarnings =
ignore::DeprecationWarning
default:::esi_leap:
3 changes: 2 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ PyMySQL>=0.7.6 # MIT License
iso8601>=0.1.11 # MIT
oslotest>=3.2.0 # Apache-2.0
osprofiler>=1.5.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
psycopg2>=2.6.2 # LGPL/ZPL
pytest>=8.2.0 # MIT
pytest-cov>=5.0.0 # MIT
testtools>=2.2.0 # MIT
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
Expand Down
12 changes: 1 addition & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@ setenv = VIRTUAL_ENV={envdir}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
commands = pytest -v --cov=esi_leap {posargs}

[testenv:pep8]
commands = flake8 esi_leap {posargs}

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source esi_leap --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml

[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
Expand Down

0 comments on commit 0626590

Please sign in to comment.