Skip to content

Commit c09eb25

Browse files
authored
Merge pull request #725 from derekschrock/pytest_runner
Only require pytest_runner if tests are run
2 parents 23d3b8e + be7ad4c commit c09eb25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
tests_require = ["pytest>=5,<6", "pytest-cov>=2,<3", "codecov>=2,<3", "flake8>=3,<4", "black", "psutil"]
1919

20+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
21+
pytest_runner = ['pytest-runner'] if needs_pytest else []
22+
2023

2124
class BaseCommand(Command):
2225
"""Base Command"""
@@ -182,7 +185,7 @@ def run(self):
182185
),
183186
install_requires=["aiohttp>3.5.2,<4.0.0"],
184187
extras_require={"optional": ["aiodns>1.0"]},
185-
setup_requires=["pytest-runner"],
188+
setup_requires=pytest_runner,
186189
test_suite="tests",
187190
tests_require=tests_require,
188191
cmdclass={

0 commit comments

Comments
 (0)