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
1
2
import re
2
3
3
4
from 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 )
4
25
5
26
6
27
with open ('pytestqt/__init__.py' ) as f :
7
28
m = re .search ("version = '(.*)'" , f .read ())
8
29
assert m is not None
9
30
version = m .group (1 )
10
31
11
-
12
32
setup (
13
33
name = "pytest-qt" ,
14
34
version = version ,
40
60
'Topic :: Software Development :: User Interfaces' ,
41
61
],
42
62
tests_requires = ['pytest' ],
63
+ cmdclass = {'test' : PyTest },
43
64
)
You can’t perform that action at this time.
0 commit comments