diff --git a/.gitignore b/.gitignore index 90250e6..261d284 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/pytest.ini b/pytest.ini index fc08a50..d3625ab 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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' diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b7e4789 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[aliases] +test=pytest diff --git a/setup.py b/setup.py index 53bad10..eb69fc6 100644 --- a/setup.py +++ b/setup.py @@ -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',