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
EnMAP
sensormapgeo
Commits
1180afc0
Commit
1180afc0
authored
Nov 26, 2021
by
Daniel Scheffler
Browse files
Merge branch 'enhancement/migrate_to_pytest' into 'master'
Enhancement/migrate to pytest See merge request
!8
parents
2aeed839
396ac5a5
Pipeline
#35277
passed with stages
in 7 minutes and 28 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.coveragerc
0 → 100644
View file @
1180afc0
# .coveragerc to control coverage.py
[run]
branch = False
concurrency = multiprocessing
parallel = True
[report]
show_missing = True
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
ignore_errors = True
[html]
directory = htmlcov
.gitlab-ci.yml
View file @
1180afc0
...
...
@@ -12,20 +12,27 @@ test_sensormapgeo:
script
:
-
source /root/mambaforge/bin/activate ci_env
-
pip install
'
py
r
es
ample<1.17.0'
# https://github.com/pytroll/pyresample/issues/325
-
pip install py
t
es
t pytest-cov pytest-reporter-html1
# run nosetests
-
make nosetests
# run tests
-
make pytest
# run tests
-
make tests
# 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
...
...
@@ -84,7 +91,7 @@ pages: # this job must be called 'pages' to advise GitLab to upload content to
-
mkdir public
-
mkdir -p public/doc
-
mkdir -p public/coverage
-
mkdir -p public/
nose
tests_reports
-
mkdir -p public/tests_reports
# Copy over the docs
-
cp -r docs/_build/html/* public/doc/
...
...
@@ -92,14 +99,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
tests reports
-
cp
nosetests.*
public/
nose
tests_reports/
# Copy over the tests reports
-
cp
report.html
public/tests_reports/
# Check if everything is working great
-
ls -al public
-
ls -al public/doc
-
ls -al public/coverage
-
ls -al public/
nose
tests_reports
-
ls -al public/tests_reports
artifacts
:
paths
:
-
public
...
...
HISTORY.rst
View file @
1180afc0
...
...
@@ -6,10 +6,16 @@ History
------------------
* Replaced deprecated gdalnumeric import.
* Disabled bilinear resampling for map to sensor geometry transformation due to upstream incompatibility
(
https://git.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues/7
).
*
`!7`_:
Disabled bilinear resampling for map to sensor geometry transformation due to upstream incompatibility
(
closes `#7`_
).
* Removed pyresample version pinning which fixes multiple DeprecationWarnings.
* `!8`_: Tests are now called via pytest instead of nosetest. This improves stability and test output and adds nice
reports. Coverage now works in multiprocessing after properly closing and joining multiprocessing.Pool and adding
.coveragerc.
.. _#7: https://git.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues/7
.. _!7: https://git.gfz-potsdam.de/EnMAP/sensormapgeo/-/merge_requests/7
.. _!8: https://git.gfz-potsdam.de/EnMAP/sensormapgeo/-/merge_requests/8
0.5.0 (2021-09-27)
------------------
...
...
Makefile
View file @
1180afc0
.PHONY
:
clean clean-test clean-pyc clean-build docs help
.PHONY
:
clean clean-test clean-pyc clean-build docs help
pytest
.DEFAULT_GOAL
:=
help
define
BROWSER_PYSCRIPT
...
...
@@ -48,8 +48,10 @@ 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 sensormapgeo tests
>
./tests/linting/flake8.log
||
\
...
...
@@ -81,6 +83,24 @@ nosetests: clean-test ## Runs nosetests with coverage, xUnit and nose-html-outpu
nosetests
-vv
--with-coverage
--cover-package
=
sensormapgeo
--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 pyteest-cov
)
are defined
in
.pytest.ini and .coveragerc
pytest tests
\
--verbosity
=
3
\
--color
=
yes
\
--tb
=
short
\
--cov
=
sensormapgeo
\
--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/sensormapgeo.rst
rm
-f
docs/modules.rst
...
...
setup.py
View file @
1180afc0
...
...
@@ -43,12 +43,11 @@ requirements = ['numpy', 'gdal', 'pyresample>=1.11.0', 'py_tools_ds>=0.18.0', 'p
setup_requirements
=
[]
test_requirements
=
[
'
coverage'
,
'nose'
,
'nose-htmloutput'
,
'rednose
'
,
'urlchecker'
]
test_requirements
=
[
'
pytest'
,
'pytest-cov'
,
'pytest-reporter-html1
'
,
'urlchecker'
]
setup
(
author
=
"Daniel Scheffler"
,
author_email
=
'daniel.scheffler@gfz-potsdam.de'
,
python_requires
=
'>=3.6'
,
classifiers
=
[
'Development Status :: 4 - Beta'
,
'Intended Audience :: Developers'
,
...
...
@@ -58,6 +57,7 @@ setup(
'Programming Language :: Python :: 3.6'
,
'Programming Language :: Python :: 3.7'
,
'Programming Language :: Python :: 3.8'
,
'Programming Language :: Python :: 3.9'
],
description
=
"A package for transforming remote sensing images between sensor and map geometry."
,
install_requires
=
requirements
,
...
...
@@ -67,6 +67,7 @@ setup(
keywords
=
'sensormapgeo'
,
name
=
'sensormapgeo'
,
packages
=
find_packages
(
exclude
=
[
'tests*'
]),
python_requires
=
'>=3.6'
,
setup_requires
=
setup_requirements
,
test_suite
=
'tests'
,
tests_require
=
test_requirements
,
...
...
tests/CI_docker/context/environment_sensormapgeo.yml
View file @
1180afc0
...
...
@@ -16,15 +16,13 @@ dependencies:
-
pip
:
-
pebble
-
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