Skip to content

Commit a200255

Browse files
committed
setup.py: Enable tests discovery
1 parent 2d69a4c commit a200255

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import subprocess
33
import sys
4+
import unittest
45

56

67
if sys.platform in ('win32', 'cygwin', 'cli'):
@@ -16,6 +17,12 @@
1617
LIBUV_DIR = os.path.join(os.path.dirname(__file__), 'vendor', 'libuv')
1718

1819

20+
def discover_tests():
21+
test_loader = unittest.TestLoader()
22+
test_suite = test_loader.discover('tests', pattern='test_*.py')
23+
return test_suite
24+
25+
1926
class libuv_build_ext(build_ext):
2027
build_ext.user_options.extend([
2128
("use-system-libuv", None,
@@ -97,5 +104,6 @@ def build_extensions(self):
97104
'Intended Audience :: Developers',
98105
],
99106
provides=['uvloop'],
100-
include_package_data=True
107+
include_package_data=True,
108+
test_suite='setup.discover_tests'
101109
)

0 commit comments

Comments
 (0)