mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-22 10:15:55 +01:00
7b1567c352
Improvements to the test suite: * List release version names and numbers in minecraft/__init__.py. * Make some tests, which previously ran for *all* protocol versions, run only for release protocol versions (to improve test performance). * Make some tests, which previously ran only for the latest protocol version, run for all release protocol versions (to improve coverage). * Print each protocol version being tested to the debug log, to help identify sources of errors. * Use the `nose-timer' plugin to show the run time of each test. Fix errors revealed by increased test coverage: * Fix: SoundEffectPacket.Pitch is not serialised correctly for early protocol versions. * Fix: handleExceptionTest finishes later than necessary because the test overrode an exception handler used internally by `_FakeServerTest', causing the server thread to time out after 4s. * Add support for multiple exception handlers in `Connection' (required for the above). Improvements to data descriptors: * Make syntax of property declarations more consistent/Pythonic. * Factor the definition of several aliasing properties into the utility methods `attribute_alias' and `multi_attribute_alias', which construct suitable data descriptors. * Define and use the named tuple `Direction' for (pitch, yaw) values.
91 lines
1.7 KiB
INI
91 lines
1.7 KiB
INI
# Tox (http://tox.testrun.org/) 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, py34, py35, py36, pypy, flake8, pylint-errors, pylint-full, verify-manifest
|
|
|
|
[testenv]
|
|
commands = nosetests --with-timer
|
|
|
|
deps =
|
|
nose
|
|
nose-timer
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[testenv:cover]
|
|
deps =
|
|
{[testenv]deps}
|
|
coverage
|
|
nosexcover
|
|
|
|
[testenv:coveralls]
|
|
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
|
commands =
|
|
coveralls
|
|
deps =
|
|
coveralls
|
|
|
|
[testenv:py27]
|
|
deps =
|
|
{[testenv]deps}
|
|
mock
|
|
|
|
[testenv:py36]
|
|
setenv =
|
|
PYCRAFT_RUN_INTERNET_TESTS=1
|
|
commands =
|
|
{[testenv]commands} --with-xunit --with-xcoverage --cover-package=minecraft --cover-erase --cover-inclusive --cover-tests --cover-branches --cover-min-percentage=60
|
|
deps =
|
|
{[testenv:cover]deps}
|
|
|
|
[testenv:pypy]
|
|
deps =
|
|
{[testenv]deps}
|
|
mock
|
|
|
|
[testenv:flake8]
|
|
basepython = python3.6
|
|
commands =
|
|
flake8 minecraft tests setup.py start.py bin/generate_travis_yml.py
|
|
deps =
|
|
{[testenv]deps}
|
|
flake8
|
|
|
|
[flake8]
|
|
per-file-ignores =
|
|
*/clientbound/play/spawn_object_packet.py:E221,E222,E271,E272
|
|
|
|
[testenv:pylint-errors]
|
|
basepython = python3.6
|
|
deps =
|
|
{[testenv]deps}
|
|
pylint
|
|
commands = pylint minecraft -E
|
|
|
|
[testenv:pylint-full]
|
|
basepython = python3.6
|
|
deps =
|
|
{[testenv]deps}
|
|
pylint
|
|
commands =
|
|
- pylint minecraft --disable=E
|
|
|
|
[testenv:docs]
|
|
basepython = python3.6
|
|
deps =
|
|
{[testenv:cover]deps}
|
|
sphinx
|
|
sphinx-rtd-theme
|
|
commands =
|
|
{toxinidir}/bin/build_docs
|
|
|
|
[testenv:verify-manifest]
|
|
basepython = python3.6
|
|
deps =
|
|
check-manifest
|
|
commands =
|
|
check-manifest
|
|
|