From d1f371b0a5d4acbf05a2c3d1ad9fe1f6b1598452 Mon Sep 17 00:00:00 2001 From: Shawn Hartsock Date: Mon, 25 Aug 2014 17:42:11 -0400 Subject: [PATCH] tox support initial tox support addresses: https://github.com/vmware/pyvmomi/issues/131 closes: https://github.com/vmware/pyvmomi/issues/136 --- MANIFEST.in | 1 + README.rst | 8 ++++++++ setup.py | 2 +- test-requirements.txt | 2 -- tox.ini | 6 ++++++ 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tox.ini diff --git a/MANIFEST.in b/MANIFEST.in index ed784d2..81f690a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include README.* include *.txt include setup.py +include tox.ini recursive-include tests * recursive-include sample * diff --git a/README.rst b/README.rst index 9dc9935..3b00d0e 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,14 @@ posted to `pypi `_ ``python setup.py develop`` for development install or ``python setup.py install``. +Testing +======= +Unit tests can be invoked by using the ``tox`` command. You may have to +configure multiple python interpreters so that you can test in all the +environments listed in ``tox.ini`` or you will have to run ``tox`` with the +``-e`` flag to run only in your version of python. For example, if you only +have Python 2.7 then ``tox -e py27`` will limit your test run to Python 2.7. + Contributing ============ * Research `open issues `_ diff --git a/setup.py b/setup.py index 507da16..bdbf133 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ setup( install_requires=required, license='License :: OSI Approved :: Apache Software License', data_files = [("", ["LICENSE.txt", "NOTICE.txt", "MANIFEST.in", - "setup.py"])], + "setup.py", "tox.ini"])], # NOTE: pypi prefers the use of RST to render docs long_description=read('README.rst'), classifiers=[ diff --git a/test-requirements.txt b/test-requirements.txt index c55140b..40c8478 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,2 @@ -contextdecorator -PyYAML>=3.10 testtools>=0.9.34 vcrpy diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..0d419a4 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ +[tox] +envlist = py26,py27,py33,py34 +[testenv] +deps = -rtest-requirements.txt +commands = + python setup.py test