Skip to content

Commit

Permalink
Fix coverage (#307)
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Pastor Muela <[email protected]>
Co-authored-by: Kerry McAdams <[email protected]>
  • Loading branch information
3 people authored Feb 5, 2024
1 parent 8d3b136 commit 3a6affc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ on:
required: true
default: 'ubuntu-latest'


env:
MAIN_PYTHON_VERSION: '3.10'

jobs:

tests:
Expand Down Expand Up @@ -79,7 +75,7 @@ jobs:

- name: Upload coverage results
uses: actions/upload-artifact@v4
if: github.event.inputs.python-version == env.MAIN_PYTHON_VERSION
if: ${{ inputs.python-version == '3.10' }}
with:
name: coverage-html
path: .cov/html
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ cython_debug/
# End of https://www.toptal.com/developers/gitignore/api/python

doc/source/api/schemas
test_results.xml
test_results*.xml
mapdl_motorbike_frame.zip
examples/mapdl_motorbike_frame/task_input_file*
22 changes: 7 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ version = "0.7.dev0"
description = "A python client for Ansys HPC Platform Services"
readme = "README.rst"
requires-python = ">=3.9,<4.0"
license = {file = "LICENSE"}
authors = [
{name = "ANSYS, Inc.", email = "[email protected]"},
]
maintainers = [
{name = "ANSYS, Inc.", email = "[email protected]"},
]
license = { file = "LICENSE" }
authors = [{ name = "ANSYS, Inc.", email = "[email protected]" }]
maintainers = [{ name = "ANSYS, Inc.", email = "[email protected]" }]

classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -40,10 +36,7 @@ dependencies = [
]

[project.optional-dependencies]
tests = [
"pytest==8.0.0",
"pytest-cov==4.1.0",
]
tests = ["pytest==8.0.0", "coverage==7.4.1"]

doc = [
"ansys-sphinx-theme==0.13.2",
Expand All @@ -67,7 +60,7 @@ build = [
"build==1.0.3",
"twine==4.0.2",
"wheel",
"datamodel-code-generator==0.24.2"
"datamodel-code-generator==0.24.2",
]

[project.urls]
Expand Down Expand Up @@ -107,10 +100,9 @@ log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
addopts = """-ra -s --durations=0 -p pytest_cov --cov=ansys.hps --cov-report html:.cov/html \
--cov-report xml:.cov/xml --cov-report term -vv --cov-append"""
addopts = "-ra -vv"
filterwarnings = [
"ignore::urllib3.exceptions.InsecureRequestWarning",
"ignore::DeprecationWarning:pkg_resources.*",
"ignore::ansys.hps.client.UnverifiedHTTPSRequestsWarning",
]
]
13 changes: 10 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
description = Default tox environments list
envlist =
style,{py39,py310,py311,py312}{,-coverage},doc
style,py{39,310,311,312}{,-coverage},doc
skip_missing_interpreters = true

[testenv]
Expand All @@ -16,11 +16,18 @@ basepython =
passenv = HPS_TEST_*
setenv =
PYTHONUNBUFFERED = yes
coverage: PYTEST_EXTRA_ARGS = -ra -s --durations=0 -p pytest_cov --cov=ansys.hps --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term
PYTEST_EXTRA_ARGS = -ra
deps =
-e .[tests]
commands =
coverage run -m pytest {env:PYTEST_EXTRA_ARGS:} --junitxml test_results-{envname}.xml {posargs:-vv --cov-append}
pytest {env:PYTEST_EXTRA_ARGS:} --junitxml test_results-{envname}.xml {posargs:-vv}

[testenv:py{39,310,311,312}-coverage]
commands =
coverage run -m pytest {env:PYTEST_EXTRA_ARGS:} --junitxml test_results-{envname}.xml {posargs:-vv}
coverage report
coverage html
coverage xml

[testenv:style]
description = Checks project code style
Expand Down

0 comments on commit 3a6affc

Please sign in to comment.