Skip to content

Commit cddbf9d

Browse files
committed
Update setup.py test configuration
1 parent d757d42 commit cddbf9d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

setup.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import multiprocessing
12
import sys
23

34
from setuptools import find_packages, setup
@@ -9,6 +10,8 @@
910
required = f.read().splitlines()
1011
URL = "https://github.com/bogdandm/json2python-models"
1112

13+
CPU_N = multiprocessing.cpu_count()
14+
1215

1316
class PyTest(TestCommand):
1417
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
@@ -20,8 +23,10 @@ def initialize_options(self):
2023
def run_tests(self):
2124
import shlex
2225
import pytest
23-
24-
errno = pytest.main(shlex.split(self.pytest_args + ' -m "not slow_http"'))
26+
args = self.pytest_args
27+
if CPU_N > 1 and "-n " not in args:
28+
args += f" -n {CPU_N}"
29+
errno = pytest.main(shlex.split(args))
2530
sys.exit(errno)
2631

2732

@@ -31,6 +36,7 @@ def run_tests(self):
3136
python_requires=">=3.7",
3237
url=URL,
3338
author="bogdandm (Bogdan Kalashnikov)",
39+
author_email="bogdan.dm1995@yandex.ru",
3440
description="Python models (attrs, dataclasses or custom) generator from JSON data with typing module support",
3541
license="MIT",
3642
packages=find_packages(exclude=['test', 'testing_tools']),
@@ -39,9 +45,6 @@ def run_tests(self):
3945
},
4046
install_requires=required,
4147
cmdclass={"test": PyTest},
42-
tests_require=["pytest", "requests", "attrs"],
43-
project_urls={
44-
'Source': URL
45-
},
48+
tests_require=["pytest", "pytest-xdist", "requests", "attrs"],
4649
data_files=[('', ['pytest.ini', '.coveragerc', 'LICENSE'])]
4750
)

0 commit comments

Comments
 (0)