← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/txpkgupload:tox into txpkgupload:master

 

Colin Watson has proposed merging ~cjwatson/txpkgupload:tox into txpkgupload:master.

Commit message:
Add tox testing support

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/txpkgupload/+git/txpkgupload/+merge/393346

This will make it easier to test across multiple Python versions once we finish adding Python 3 support.

It's also more idiomatic for the default make target to be "compile" rather than "check".
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/txpkgupload:tox into txpkgupload:master.
diff --git a/.gitignore b/.gitignore
index 0c7b309..a232084 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ dist
 /download-cache
 src/twisted/plugins/dropin.cache
 /version-info.py
+/.tox
diff --git a/Makefile b/Makefile
index a7f506d..503f793 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ TWISTD = $(ENV)/bin/twistd
 VERSION_INFO = version-info.py
 
 
-default: check
+default: compile
 
 
 bootstrap compile:
@@ -30,8 +30,8 @@ $(VERSION_INFO):
 	scripts/update-version-info.sh
 
 
-check: compile
-	$(ENV)/bin/python -m unittest discover src
+check: | $(DEPENDENCY_DIR)
+	tox
 
 
 dist:
diff --git a/dependencies-devel.txt b/dependencies-devel.txt
index e5e3e51..717290e 100644
--- a/dependencies-devel.txt
+++ b/dependencies-devel.txt
@@ -5,4 +5,5 @@ libssl-dev
 make
 python
 python-dev
+tox
 virtualenv
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..d286a91
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,11 @@
+[tox]
+envlist =
+    py27
+
+[testenv]
+install_command =
+    python -m pip install --no-index --find-links file://{toxinidir}/download-cache/ {opts} {packages}
+commands =
+    python -m unittest discover src
+deps =
+    .[test]