From a2d846052e2dc2d1ad3961435a712ad26930aa04 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 3 Aug 2020 12:24:41 +0200 Subject: [PATCH] document pytest in HACKING, tox.ini and .travis.yml --- .travis.yml | 2 +- HACKING | 26 +------------------------- tox.ini | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index c6e6dcb..7e9bfca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,4 +27,4 @@ matrix: install: pip install wheel pillow pytest pdfrw pikepdf script: - python --version - - python setup.py test + - python -m pytest diff --git a/HACKING b/HACKING index c9d321f..1c77ee9 100644 --- a/HACKING +++ b/HACKING @@ -8,31 +8,7 @@ img2pdf can be run directly from the cloned git repository: Running the testsuite --------------------- - $ python3 setup.py test - $ ./test.sh - -Fixing the setup.py testsuite ------------------------------ - -Sometimes your changes will break the testsuite. The testsuite works by -comparing the images found in `src/tests/input` with the corresponding PDF -documents in `src/tests/output`. The filename of the output file will be the -same name the input has with the `.pdf` suffix appended to it. To generate the -files in the `src/tests/output` directory via the command line, run: - - $ src/img2pdf.py --producer="" --nodate src/tests/input/normal.jpg -o src/tests/output/normal.jpg.pdf - -This makes it easier to spot where the differences are and how to fix the -issue. - -Fixing the test.sh testsuite ----------------------------- - -If your changes break test.sh, then the script will abort immediately and tell -you where it left the temporary files for you to inspect. You can also try -running the script like this for maximum verbosity: - - $ sh -x ./test.sh + $ pytest Making a new release -------------------- diff --git a/tox.ini b/tox.ini index 459ac1c..b277f76 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,18 @@ +# tox (https://tox.readthedocs.io/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + [tox] -envlist = py27,py35,pypy +envlist = py34, py35, py36, pypy, jython +skip_missing_interpreters = true [testenv] deps = - .[test] + pdfrw + pytest + pikepdf + numpy + scipy commands = - python setup.py test -q - + pytest