Skip to content

Commit

Permalink
removed unnecessary 'setup.py test' support because it was breaking a…
Browse files Browse the repository at this point in the history
… lot
  • Loading branch information
Qwlouse committed Jan 17, 2016
1 parent 8d09b3e commit d7e195c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ lint:
flake8 sacred

test: clean-pyc clean-test
python setup.py test
py.test

test-all: clean-pyc
tox

coverage: clean-pyc
coverage run --source sacred setup.py test
coverage report -m
py.test --cov sacred
coverage html
xdg-open htmlcov/index.html

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ optional dependencies but they offer some cool features:
Tests
-----
The tests for sacred use the `py.test <http://pytest.org/latest/>`_ package.
You can execute them like this:
You can execute them by running ``py.test`` in the sacred directory like this:

python setup.py test
py.test

There is also a config file for `tox <https://testrun.org/tox/latest/>`_ so you
can automatically run the tests for various python versions like this:
Expand Down
24 changes: 0 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env python
# coding=utf-8
import sys

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

classifiers = """
Development Status :: 5 - Production/Stable
Expand All @@ -25,31 +22,11 @@
about = __about__.__dict__
except ImportError:
# installing - dependencies are not there yet
ext_modules = []
# Manually extract the __about__
about = dict()
exec(open("sacred/__about__.py").read(), about)


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def finalize_options(self):
TestCommand.finalize_options(self)
del self.test_args[:]
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)


setup(
name='sacred',
version=about['__version__'],
Expand All @@ -65,7 +42,6 @@ def run_tests(self):
'docopt', 'six', 'wrapt'
],
tests_require=['mock', 'mongomock', 'pytest'],
cmdclass={'test': PyTest},

classifiers=list(filter(None, classifiers.split('\n'))),
description='Facilitates automated and reproducible experimental research',
Expand Down

0 comments on commit d7e195c

Please sign in to comment.