Add a tox config and some very primitive pip-grep and pip-diff tests

pip-grep and pip-diff were previously not tested at all. Ideally they
would be unit-tested from Python, however they'd need some refactoring
(they can't even be imported at present), so for now this is better than
nothing.

Another option for the future is possibly:
https://scripttest.readthedocs.io
This commit is contained in:
Ed Morley
2016-05-17 17:47:33 +01:00
parent 47ad229596
commit 433e02ec7e
7 changed files with 53 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
/.tox
/*.egg-info
*.pyc
+8
View File
@@ -23,3 +23,11 @@ Possible Future Commands
------------------------
- Install with blacklisting support (wsgiref, distribute, setuptools).
Development
-----------
To run the tests:
1. ``pip install -r requirements.txt``
2. ``tox``
+1
View File
@@ -1 +1,2 @@
docopt==0.6.2
tox==2.3.1
+1
View File
@@ -19,6 +19,7 @@ setup(
zip_safe=False,
platforms='any',
install_requires=['docopt', 'pip>=1.5.0'],
tests_require=['tox'],
classifiers=[
# As from https://pypi.python.org/pypi?%3Aaction=list_classifiers
#'Development Status :: 1 - Planning',
+3
View File
@@ -0,0 +1,3 @@
cffi
django
requests[security]
+3
View File
@@ -0,0 +1,3 @@
Django==1.9.6
gunicorn
requests[security]
+34
View File
@@ -0,0 +1,34 @@
[tox]
# To reduce the size of the test matrix, tests the following pip versions:
# * all of the latest major version releases (8.x)
# * only the first and last point release of each older major version
# * plus the latest distro version available via LTS Ubuntu package managers:
# (1.5.4 for Trusty, 8.1.1 for Xenial).
envlist = pip{154,156,600,611,700,712,800,801,802,803,810,811,812}
[testenv]
# Speeds up pip install and reduces log spam, for compatible versions of pip.
setenv = PIP_DISABLE_PIP_VERSION_CHECK=1
deps =
pip154: pip==1.5.4
pip156: pip==1.5.6
pip600: pip==6.0.0
pip611: pip==6.1.1
pip700: pip==7.0.0
pip712: pip==7.1.2
pip800: pip==8.0.0
pip801: pip==8.0.1
pip802: pip==8.0.2
pip803: pip==8.0.3
pip810: pip==8.1.0
pip811: pip==8.1.1
pip812: pip==8.1.2
# TODO: Replace with something like https://scripttest.readthedocs.io or else
# rework the pip-grep and pip-diff scripts so they can more easily be unit-tested.
commands =
pip-grep tests/test-requirements.txt cffi
pip-grep tests/test-requirements.txt requests
pip-diff --fresh tests/test-requirements.txt tests/test-requirements2.txt
pip-diff --stale tests/test-requirements.txt tests/test-requirements2.txt