Skip to content

Commit

Permalink
Fixed django-pylibmc#13 -- Added support for running tests using tox.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeykolosov committed Apr 19, 2014
1 parent a4e4017 commit 221bd0d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.tox
6 changes: 5 additions & 1 deletion README.rst
Expand Up @@ -82,6 +82,10 @@ to get the default timeout.
Testing
-------

Install `tox <http://tox.testrun.org/>`_::

pip install tox

Run the tests like this::

python tests/test.py
tox
17 changes: 17 additions & 0 deletions setup.py
@@ -1,8 +1,23 @@
import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand

import django_pylibmc


class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import tox
errno = tox.cmdline(self.test_args)
sys.exit(errno)


setup(
name='django-pylibmc',
version=django_pylibmc.__version__,
Expand All @@ -16,6 +31,8 @@
include_package_data=True,
zip_safe=False,
install_requires=['pylibmc', 'Django>=1.2'],
tests_require=['tox'],
cmdclass = {'test': Tox},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
@@ -0,0 +1,10 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py26, py27

[testenv]
commands = {envpython} tests/tests.py

0 comments on commit 221bd0d

Please sign in to comment.