Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
arosics
Commits
deb816a8
Commit
deb816a8
authored
Dec 15, 2021
by
Daniel Scheffler
Browse files
Migrate unittest test calls from nosetests to pytest.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
c906618c
Changes
5
Hide whitespace changes
Inline
Side-by-side
.coveragerc
View file @
deb816a8
...
...
@@ -3,8 +3,11 @@
branch = False
concurrency = multiprocessing
parallel = True
omit = */site-packages/*,*/tests/*,*/.eggs/*
[report]
show_missing = True
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
...
...
.gitlab-ci.yml
View file @
deb816a8
...
...
@@ -13,21 +13,28 @@ test_arosics:
script
:
-
source /root/mambaforge/bin/activate ci_env
-
pip install pytest pytest-cov pytest-reporter-html1
# TODO remove after recreating CI runner
# update py_tools_ds and geoarray
-
pip install -U py_tools_ds -q
-
pip install -U geoarray -q
# run tests
-
make
nose
test
s
-
make
py
test
# create the docs
-
make docs
artifacts
:
expose_as
:
'
Test
and
coverage
report'
paths
:
-
htmlcov/
-
report.html
-
docs/_build/html/
-
nosetests.html
-
nosetests.xml
reports
:
cobertura
:
coverage.xml
junit
:
report.xml
expire_in
:
30 days
when
:
always
...
...
@@ -87,7 +94,7 @@ pages: # this job must be called 'pages' to advise GitLab to upload content to
-
mkdir -p public/doc
-
mkdir -p public/images/
-
mkdir -p public/coverage
-
mkdir -p public/
nose
test
s
_reports
-
mkdir -p public/test_reports
# Copy over the docs
-
cp -r docs/_build/html/* public/doc/
...
...
@@ -96,14 +103,14 @@ pages: # this job must be called 'pages' to advise GitLab to upload content to
# Copy over the coverage reports
-
cp -r htmlcov/* public/coverage/
# Copy over the
nose
test
s
reports
-
cp
nosetests.*
public/
nose
test
s
_reports/
# Copy over the test reports
-
cp
report.html
public/test_reports/
# Check if everything is working great
-
ls -al public
-
ls -al public/doc
-
ls -al public/coverage
-
ls -al public/
nose
test
s
_reports
-
ls -al public/test_reports
artifacts
:
paths
:
-
public
...
...
Makefile
View file @
deb816a8
.PHONY
:
clean clean-test clean-pyc clean-build docs help
nose
test
s
.PHONY
:
clean clean-test clean-pyc clean-build docs help
py
test
.DEFAULT_GOAL
:=
help
define
BROWSER_PYSCRIPT
import
os,
webbrowser,
sys
...
...
@@ -49,8 +49,11 @@ clean-test: ## remove test and coverage artifacts
rm
-f
.coverage
rm
-fr
.coverage.
*
rm
-fr
htmlcov/
rm
-fr
nosetests.html
rm
-fr
nosetests.xml
rm
-fr
report.html
rm
-fr
report.xml
rm
-fr
coverage.xml
rm
-fr
.pytest_cache
lint
:
##
check style with flake8
flake8
--max-line-length
=
120
.
tests
>
./tests/linting/flake8.log
||
\
...
...
@@ -84,6 +87,23 @@ nosetests: clean-test ## Runs nosetests with coverage, xUnit and nose-html-outpu
nosetests
-vv
--with-coverage
--cover-package
=
arosics
--cover-erase
--cover-html
--cover-html-dir
=
htmlcov
\
--with-html
--with-xunit
--rednose
--force-color
pytest
:
clean-test
##
Runs pytest with coverage and creates coverage and test report
## - puts the coverage results in the folder 'htmlcov'
## - generates cobertura 'coverage.xml'
(
needed to show coverage
in
GitLab MR changes
)
## - generates 'report.html' based on pytest-reporter-html1
## - generates JUnit 'report.xml' to show the test report as a new tab in a GitLab MR
## NOTE: additional options pytest and coverage
(
plugin pytest-cov
)
are defined
in
.pytest.ini and .coveragerc
pytest tests
\
--verbosity
=
3
\
--color
=
yes
\
--tb
=
short
\
--cov
=
arosics
\
--cov-report
html:htmlcov
\
--cov-report
term-missing
\
--cov-report
xml:coverage.xml
\
--template
=
html1/index.html
--report
=
report.html
\
--junitxml
report.xml
docs
:
##
generate Sphinx HTML documentation
,
including API docs
rm
-f
docs/arosics.rst
rm
-f
docs/modules.rst
...
...
setup.py
View file @
deb816a8
...
...
@@ -67,7 +67,7 @@ req_setup = [
req_intplot
=
[
'holoviews'
,
'ipython'
]
req_test
=
[
'
coverage'
,
'nose'
,
'nose2'
,
'nose-htmloutput'
,
'rednose
'
,
'urlchecker'
]
+
req_intplot
req_test
=
[
'
pytest'
,
'pytest-cov'
,
'pytest-reporter-hmtl1
'
,
'urlchecker'
]
+
req_intplot
req_doc
=
[
'sphinx-argparse'
,
'sphinx_rtd_theme'
,
'sphinx-autodoc-typehints'
]
...
...
tests/CI_docker/context/environment_arosics.yml
View file @
deb816a8
...
...
@@ -31,15 +31,13 @@ dependencies:
-
geojson
# doc requirements
-
coverage
-
flake8
-
nose
-
nose2
-
nose-htmloutput
-
pycodestyle
-
pydocstyle
-
pylint
-
rednose
-
pytest
-
pytest-cov
-
pytest-reporter-html1
-
sphinx-argparse
-
sphinx-autodoc-typehints
-
sphinx_rtd_theme
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment