Make python setup.py test works on an new environment

This commit is contained in:
Toilal
2015-11-02 11:30:54 +01:00
parent 938b8512a0
commit dfbfc0c106
4 changed files with 11 additions and 19 deletions
+4
View File
@@ -5,6 +5,7 @@ dist/
# Python dist
*.egg-info/
.eggs/
# Coverage
.coverage
@@ -15,6 +16,9 @@ dist/
# Tox
.tox/
# py.test
lastfailed
# Jetbrain
*.iml
.idea/
+1 -1
View File
@@ -1,2 +1,2 @@
[pytest]
addopts =-s --ignore=setup.py --doctest-modules --doctest-glob='README.rst'
addopts =-s --ignore=setup.py --ignore=build --doctest-modules --doctest-glob='README.rst'
+2
View File
@@ -0,0 +1,2 @@
[aliases]
test=pytest
+4 -18
View File
@@ -13,7 +13,9 @@ HISTORY = open(os.path.join(here, 'HISTORY.rst')).read()
install_requires = ['rebulk>=0.4.1', 'regex', 'babelfish>=0.5.5', 'python-dateutil']
tests_require = ['pytest', 'pyyaml']
setup_requires=['pytest-runner']
tests_require = ['pytest', 'PyYAML']
entry_points = {
'console_scripts': [
@@ -22,22 +24,6 @@ entry_points = {
}
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 = ['--ignore=setup.py', '--doctest-modules']
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
def run(self):
import pytest
errno = pytest.main(self.pytest_args)
exit(errno)
exec(open("guessit/__version__.py").read()) # load version without importing guessit
args = dict(name='guessit',
@@ -65,9 +51,9 @@ args = dict(name='guessit',
download_url='https://pypi.python.org/packages/source/g/guessit/guessit-%s.tar.gz' % __version__,
license='LGPLv3',
packages=find_packages(),
cmdclass={"test": PyTest},
include_package_data=True,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
entry_points=entry_points,
test_suite='guessit.test',