Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pytest #68

Merged
merged 6 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ def build(python_version, compiler, label, release=false) {

CC=${compiler} ${VENV}/bin/python setup.py sdist bdist_wheel
${VENV}/bin/python ${VENV}/bin/pip install -e .
${VENV}/bin/python ${VENV}/bin/nosetests \
--with-xunit --with-coverage --cover-inclusive \
--cover-package=anonlink

${VENV}/bin/python ${VENV}/bin/pytest --cov=anonlink
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add something like --junit-xml=testout.xml --cov-report=xml:coverage.xml we can then pick up the report/s with jenkins.

"""

if(release) {
Expand Down
21 changes: 15 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Benchmark
You can run the benchmark with:

::

$ python3 -m anonlink.benchmark
Anonlink benchmark -- see README for explanation
------------------------------------------------
Expand Down Expand Up @@ -113,16 +114,24 @@ matrix, which will be approximately `#comparisons * match% / 100`.
Tests
=====

Run unit tests with nose
Run unit tests with `pytest`:

::

$ python -m nose
......................SS..............................
----------------------------------------------------------------------
Ran 54 tests in 6.615s
$ pytest
====================================== test session starts ======================================
platform linux -- Python 3.6.4, pytest-3.2.5, py-1.4.34, pluggy-0.4.0
rootdir: /home/hlaw/src/n1-anonlink, inifile:
collected 71 items

tests/test_benchmark.py ...
tests/test_bloommatcher.py ..............
tests/test_e2e.py .............ss....
tests/test_matcher.py ..x.....x......x....x..
tests/test_similarity.py .........
tests/test_util.py ...

OK (SKIP=2)
======================== 65 passed, 2 skipped, 4 xfailed in 4.01 seconds ========================

To enable slightly larger tests add the following environment variables:

Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bitarray==0.8.1
networkx==1.11
cffi>=1.7
nose==1.3.7
clkhash==0.8.0
pytest>=3.4
pytest-cov>=2.5
clkhash==0.8.0