mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
tests: fuzzy test for Obs added, test dependencies and documentation
updated.
This commit is contained in:
parent
ef23dd256f
commit
7bb164120b
5 changed files with 12 additions and 2 deletions
1
.github/workflows/pytest.yml
vendored
1
.github/workflows/pytest.yml
vendored
|
@ -40,6 +40,7 @@ jobs:
|
|||
pip install pytest
|
||||
pip install pytest-cov
|
||||
pip install pytest-benchmark
|
||||
pip install hypothesis
|
||||
pip install py
|
||||
pip freeze
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ For all pull requests tests are executed for the most recent python releases via
|
|||
pytest -vv --cov=pyerrors
|
||||
pytest -vv --nbmake examples/*.ipynb
|
||||
```
|
||||
requiring `pytest`, `pytest-cov`, `pytest-benchmark` and `nbmake`. To get a coverage report in html run
|
||||
requiring `pytest`, `pytest-cov`, `pytest-benchmark`, `hypothesis' and `nbmake`. To install the test dependencies one can run `pip install pyerrors[test]`
|
||||
|
||||
To get a coverage report in html run
|
||||
```
|
||||
pytest --cov=pyerrors --cov-report html
|
||||
```
|
||||
|
|
|
@ -10,6 +10,7 @@ import matplotlib.pyplot as plt
|
|||
from scipy.stats import skew, skewtest, kurtosis, kurtosistest
|
||||
import numdifftools as nd
|
||||
from itertools import groupby
|
||||
from hypothesis import given, strategies as st
|
||||
from .covobs import Covobs
|
||||
|
||||
# Improve print output of numpy.ndarrays containing Obs objects.
|
||||
|
|
2
setup.py
2
setup.py
|
@ -26,7 +26,7 @@ setup(name='pyerrors',
|
|||
packages=find_packages(),
|
||||
python_requires='>=3.7.0',
|
||||
install_requires=['numpy>=1.19', 'autograd>=1.5', 'numdifftools>=0.9.41', 'matplotlib>=3.5', 'scipy>=1.7', 'iminuit>=2.17', 'h5py>=3.7', 'lxml>=4.9', 'python-rapidjson>=1.9', 'pandas>=1.1'],
|
||||
extras_require={'test': ['pytest', 'pytest-cov', 'pytest-benchmark']},
|
||||
extras_require={'test': ['pytest', 'pytest-cov', 'pytest-benchmark', 'hypothesis']},
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Intended Audience :: Science/Research',
|
||||
|
|
|
@ -4,9 +4,15 @@ import copy
|
|||
import matplotlib.pyplot as plt
|
||||
import pyerrors as pe
|
||||
import pytest
|
||||
from hypothesis import given, strategies as st
|
||||
|
||||
np.random.seed(0)
|
||||
|
||||
@given(st.lists(st.floats(allow_nan=False, allow_infinity=False, width=32), min_size=5), st.text())
|
||||
def test_fuzzy_obs(data, string):
|
||||
my_obs = pe.Obs([data], [string])
|
||||
my_obs * my_obs
|
||||
|
||||
|
||||
def test_Obs_exceptions():
|
||||
with pytest.raises(Exception):
|
||||
|
|
Loading…
Add table
Reference in a new issue