Commit 8810250b authored by Jason R. Coombs's avatar Jason R. Coombs

Run tests with tox

parent 7edbffcc
...@@ -14,13 +14,13 @@ script: ...@@ -14,13 +14,13 @@ script:
# avoid VersionConflict when newer version is required # avoid VersionConflict when newer version is required
- pip install -U 'pytest>=3.0.2' - pip install -U 'pytest>=3.0.2'
# Output the env, because the travis docs just can't be trusted # Output the env, to verify behavior
- env - env
# update egg_info based on setup.py in checkout # update egg_info based on setup.py in checkout
- python bootstrap.py - python bootstrap.py
- python setup.py test --addopts='-rsx' - python -m tox
before_deploy: before_deploy:
- export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=1 - export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=1
......
...@@ -89,12 +89,10 @@ For posterity, the old `Bitbucket mirror ...@@ -89,12 +89,10 @@ For posterity, the old `Bitbucket mirror
Testing Testing
------- -------
The primary tests are run using py.test. To run the tests:: The primary tests are run using tox. To run the tests, first make
sure you have tox installed, then invoke it::
$ python setup.py test $ tox
Or install py.test into your environment and run ``PYTHONPATH=. py.test``
or ``python -m pytest``.
Under continuous integration, additional tests may be run. See the Under continuous integration, additional tests may be run. See the
``.travis.yml`` file for full details on the tests run under Travis-CI. ``.travis.yml`` file for full details on the tests run under Travis-CI.
......
...@@ -69,8 +69,6 @@ if include_windows_files: ...@@ -69,8 +69,6 @@ if include_windows_files:
package_data.setdefault('setuptools', []).extend(['*.exe']) package_data.setdefault('setuptools', []).extend(['*.exe'])
package_data.setdefault('setuptools.command', []).extend(['*.xml']) package_data.setdefault('setuptools.command', []).extend(['*.xml'])
needs_pytest = set(['ptr', 'pytest', 'test']).intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
needs_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv) needs_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv)
wheel = ['wheel'] if needs_wheel else [] wheel = ['wheel'] if needs_wheel else []
...@@ -178,14 +176,8 @@ setup_params = dict( ...@@ -178,14 +176,8 @@ setup_params = dict(
), ),
], ],
scripts=[], scripts=[],
tests_require=[
'setuptools[ssl]',
'pytest-flake8',
# pin pytest to 3.0.2 for pytest-dev/pytest#1888
'pytest==3.0.2',
] + (['mock'] if sys.version_info[:2] < (3, 3) else []),
setup_requires=[ setup_requires=[
] + pytest_runner + wheel, ] + wheel,
) )
if __name__ == '__main__': if __name__ == '__main__':
......
[tox]
envlist = py26,py27,py33,py34,py35,pypy,pypy3
[testenv] [testenv]
deps= deps=
pytest-flake8 pytest-flake8
pytest>=3.0.2 pytest>=3.0.2
setuptools[ssl]
py{26,27,32}: mock
passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir
commands=python setup.py test --addopts='-rsx' commands=python -m pytest -rsx
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment