Skip to content

Commit

Permalink
Add pytest.ini. Ignore warnings irrelevant to Lena.
Browse files Browse the repository at this point in the history
  • Loading branch information
ynikitenko committed May 7, 2020
1 parent fa39f61 commit 8376ffb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[pytest]
filterwarnings =
ignore:::markupsafe

## Ignore warnings from other packages ##

## raised when using collections module (for named tuples).
# /usr/lib64/python3.7/site-packages/markupsafe/__init__.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
5 changes: 5 additions & 0 deletions tests/structures/test_numpy_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
from lena.structures.numpy_histogram import NumpyHistogram


## Ignore numpy warning raised when trying to use an empty histogram.
# /usr/local/lib64/python3.7/site-packages/numpy/lib/histograms.py:908: RuntimeWarning: invalid value encountered in true_divide
# return n/db/n.sum(), bin_edges

@pytest.mark.filterwarnings("ignore:::numpy.lib.histograms")
def test_numpy_histogram():
nhist = NumpyHistogram(bins=list(range(0, 5)), density=True)
filled_hist = Histogram([0, 1, 2, 3, 4], bins=[0.25, 0.25, 0.25 ,0.25])
Expand Down

0 comments on commit 8376ffb

Please sign in to comment.