forked from josch/img2pdf
document pytest in HACKING, tox.ini and .travis.yml
This commit is contained in:
parent
a84a1b8480
commit
a2d846052e
3 changed files with 15 additions and 30 deletions
|
@ -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
26
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
|
||||
--------------------
|
||||
|
|
17
tox.ini
17
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
|
||||
|
|
Loading…
Reference in a new issue