document pytest in HACKING, tox.ini and .travis.yml

This commit is contained in:
Johannes 'josch' Schauer 2020-08-03 12:24:41 +02:00
parent a84a1b8480
commit a2d846052e
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
3 changed files with 15 additions and 30 deletions

View file

@ -27,4 +27,4 @@ matrix:
install: pip install wheel pillow pytest pdfrw pikepdf
script:
- python --version
- python setup.py test
- python -m pytest

26
HACKING
View file

@ -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
--------------------

17
tox.ini
View file

@ -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