summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Cabrera <alejandro.cabrera@rackspace.com>2014-01-15 13:18:16 -0500
committerAlejandro Cabrera <alejandro.cabrera@rackspace.com>2014-01-15 13:18:16 -0500
commitf18df4ea275a0c586ff6fc68cbc9fbdfe7c66874 (patch)
treed24d181d3ee865b19f238268f3ac817c93427f18
parent794b02811d8c6fdad304955a4602fb1324270f95 (diff)
downloadpython-memcached-f18df4ea275a0c586ff6fc68cbc9fbdfe7c66874.tar.gz
feat(tox): add support for testing with tox
This adds notes in the README and a tox.ini file for use with the tox test manager. This helps greatly towards migrating python-memcached towards python 3.3+ compatibility.
-rw-r--r--.gitignore1
-rw-r--r--README.md13
-rw-r--r--tests/Makefile7
-rw-r--r--tests/test_setmulti.py2
-rw-r--r--tox.ini26
5 files changed, 40 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index e18136f..203dc32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*.pyc
/dist
/python_memcached.egg-info
+.tox
diff --git a/README.md b/README.md
index 2f29ab7..4fee26a 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+## Overview
+
This software is a 100% Python interface to the memcached memory cache
daemon. It is the client side software which allows storing values in one
or more, possibly remote, memcached servers. Search google for memcached
@@ -14,3 +16,14 @@ Please report issues and submit code changes to the github repository at:
For changes prior to 2013-03-26, see the old Launchpad repository at:
Historic issues: https://launchpad.net/python-memcached
+
+## Testing
+
+Test patches locally and easily by running tox:
+
+ pip install tox
+ tox -e py27
+
+Test for style by running tox:
+
+ tox -e pep8
diff --git a/tests/Makefile b/tests/Makefile
deleted file mode 100644
index a844aa4..0000000
--- a/tests/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-TESTS = $(wildcard test_*.py)
-
-test:
- @- $(foreach TEST,$(TESTS), \
- echo === Running test: $(TEST); \
- python $(TEST); \
- )
diff --git a/tests/test_setmulti.py b/tests/test_setmulti.py
index 815ccfd..3607f02 100644
--- a/tests/test_setmulti.py
+++ b/tests/test_setmulti.py
@@ -63,5 +63,3 @@ class test_Memcached_Set_Multi(unittest.TestCase):
if DEBUG:
print 'set_multi({0!r}) -> {1!r}'.format(mapping, bad_keys)
-
-unittest.main()
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..a1dcac2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,26 @@
+[tox]
+minversion = 1.6
+envlist = py26,py27,py33,pypy,pep8
+skipsdist = True
+
+[testenv]
+usedevelop = True
+# Customize pip command, add -U to force updates.
+install_command = pip install -U {opts} {packages}
+deps = nose
+commands = nosetests {posargs}
+
+[tox:jenkins]
+downloadcache = ~/cache/pip
+
+[testenv:pep8]
+deps = hacking
+commands = flake8
+
+[testenv:cover]
+deps = nose
+ coverage
+commands = nosetests --with-coverage {posargs}
+
+[flake8]
+exclude = .venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv