Switch to pytest

This commit is contained in:
Matthew Tretter
2013-07-31 16:54:37 -04:00
parent b92428466d
commit c2f32b8049
9 changed files with 147 additions and 131 deletions

View File

@@ -2,6 +2,7 @@
import codecs
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
@@ -12,6 +13,18 @@ execfile(os.path.join(os.path.dirname(__file__), 'markdownify', 'pkgmeta.py'),
pkgmeta)
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests', '-s']
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
raise SystemExit(errno)
setup(
name='markdownify',
description='Convert HTML to markdown.',
@@ -25,8 +38,7 @@ setup(
zip_safe=False,
include_package_data=True,
tests_require=[
'nose',
'unittest2',
'pytest',
],
install_requires=[
'lxml',
@@ -44,5 +56,7 @@ setup(
'Topic :: Utilities'
],
setup_requires=[],
test_suite='runtests.collector',
cmdclass={
'test': PyTest,
},
)