Add a testing tool chain

- use pytest as the base, measure coverage with pytest-cov
  + configure coverage to include branches and specify source locations
  + configure pytest to enforce explicit markers
- add a package for the test suite under tests/
- add a `__version__` identifier at the package's root
  + it is dynamically assigned the version of the installed package
  + the version is PEP440 compliant and follows a strict subset of
    semantic versioning: x.y.z[.devN] where x, y, z, and N are all
    non-negative integers
  + add module with tests for the __version__
- add a nox session "test" that runs the test suite
- use flake8 to lint pytest for consistent style
This commit is contained in:
Alexander Hess 2020-08-04 00:09:29 +02:00
commit 9fc5b4816a
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
7 changed files with 406 additions and 3 deletions

View file

@ -1 +1,9 @@
"""Source code for the urban-meal-delivery research project."""
from importlib import metadata
try:
__version__ = metadata.version(__name__)
except metadata.PackageNotFoundError: # pragma: no cover
__version__ = 'unknown'