File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 1+ import sys
12import re
23
34from setuptools import setup
5+ from setuptools .command .test import test as TestCommand
6+
7+
8+ class PyTest (TestCommand ):
9+ """
10+ Overrides setup "test" command, taken from here:
11+ http://pytest.org/latest/goodpractises.html
12+ """
13+
14+ def finalize_options (self ):
15+ TestCommand .finalize_options (self )
16+ self .test_args = []
17+ self .test_suite = True
18+
19+ def run_tests (self ):
20+ # import here, cause outside the eggs aren't loaded
21+ import pytest
22+
23+ errno = pytest .main ([])
24+ sys .exit (errno )
425
526
627with open ('pytestqt/__init__.py' ) as f :
728 m = re .search ("version = '(.*)'" , f .read ())
829 assert m is not None
930 version = m .group (1 )
1031
11-
1232setup (
1333 name = "pytest-qt" ,
1434 version = version ,
4060 'Topic :: Software Development :: User Interfaces' ,
4161 ],
4262 tests_requires = ['pytest' ],
63+ cmdclass = {'test' : PyTest },
4364)
You can’t perform that action at this time.
0 commit comments