Testing dotapatch¶
You can test either using tox or nosetests.
It’s recomended to use tox
in order to test the code under several Python
versions at once. Tox
will automatically skip versions that are not
installed, so don’t worry!
tox¶
You will need tox
:
$ pip install tox
Clone/download the repository, head over to the folder and run tox
:
$ git clone https://github.com/arthurazs/dotapatch.git
$ cd dotapatch
$ tox
GLOB sdist-make: /home/arthurazs/git/dotapatch/setup.py
py27 inst-nodeps: /home/arthurazs/git/dotapatch/.tox/dist/dotapatch-2.3.2.zip
[...]
26 tests run in 0.166 seconds (26 tests passed)
py33 create: /home/arthurazs/git/dotapatch/.tox/py33
ERROR: InterpreterNotFound: python3.3
py34 create: /home/arthurazs/git/dotapatch/.tox/py34
ERROR: InterpreterNotFound: python3.4
py35 inst-nodeps: /home/arthurazs/git/dotapatch/.tox/dist/dotapatch-2.3.2.zip
[...]
26 tests run in 0.172 seconds (26 tests passed)
py36 create: /home/arthurazs/git/dotapatch/.tox/py36
ERROR: InterpreterNotFound: python3.6
_________________________________ summary ___________________________________
py27: commands succeeded
SKIPPED: py33: InterpreterNotFound: python3.3
SKIPPED: py34: InterpreterNotFound: python3.4
py35: commands succeeded
SKIPPED: py36: InterpreterNotFound: python3.6
congratulations :)
nosetests¶
You will need nosetests
but the setup.py
will handle it.
Clone/download the repository, head over to the folder and run the test:
$ python setup.py test
running nosetests
[...]
file: assert 'itemdata' file exists ... passed
str: sort_item("sphere") returns "linken s sphere" ... passed
hero: get_hero_name(hero) returns hero_id ... passed
item: get_hero_name(item) returns None ... passed
main: assert get_parser() returns default values ... passed
html: assert item content is added properly ... passed
tmpl: raise error for malformed template ... passed
ptc: parse file with GENERAL section and return 1 (or greater) ... passed
[...]
-------------------------------------------------------------------------
26 tests run in 0.174 seconds (26 tests passed)