Added some helpful tools and configurations

pull/46/head
Benjamin Rosemann 4 years ago
parent 5cbd4f3d95
commit 03ad413f4a

@ -0,0 +1,2 @@
[run]
omit = qurator/dinglehopper/tests/*

@ -1,10 +1,37 @@
Testing
-------
# Testing
Use `pytest` to run the tests in [the tests directory](qurator/dinglehopper/tests):
~~~
```bash
virtualenv -p /usr/bin/python3 venv
. venv/bin/activate
pip install -r requirements.txt
pip install pytest
pip install -r requirements-dev.txt
pytest
~~~
```
### Test running examples
### Only unit tests
```bash
pytest -m "not integration"
```
### Only integration tests
```bash
pytest -m integration
```
### All tests
```bash
pytest
```
### All tests with code coverage
```bash
pytest --cov=qurator --cov-report=html
```
### Static code analysis
```bash
pytest -k "not test" --flake8
pytest -k "not test" --mypy
```

@ -0,0 +1,4 @@
pytest
pytest-flake8
pytest-cov
pytest-mypy

@ -1,2 +1,12 @@
[flake8]
max-line-length = 90
max-line-length = 88
extend-ignore = E203, W503
[pylint]
max-line-length = 88
[pylint.messages_control]
disable = C0330, C0326
[mypy]
ignore_missing_imports = True

@ -4,6 +4,9 @@ from setuptools import find_packages, setup
with open("requirements.txt") as fp:
install_requires = fp.read()
with open('requirements-dev.txt') as fp:
tests_require = fp.read()
setup(
name="dinglehopper",
author="Mike Gerber, The QURATOR SPK Team",
@ -16,6 +19,7 @@ setup(
namespace_packages=["qurator"],
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
install_requires=install_requires,
tests_require=tests_require,
package_data={
"": ["*.json", "templates/*"],
},

Loading…
Cancel
Save