Skip to content

Commit a50011d

Browse files
kwongtncclausspre-commit-ci[bot]
authored
Update test suite to use pytest, remove related in setup.py (celery#771)
* Fix setuptools to <v72 * Makefile: Use pytest instead of setup.py test * Attempt to use pytest directly * Add python -m * Update setup.py Co-authored-by: Christian Clauss <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add pytest installation to workflow * Remove pytest from setup.py * Unlock setuptools * Remove tests_require * Move pytest to tox.ini --------- Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8fe7836 commit a50011d

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ test-all: clean-pyc
139139
$(TOX)
140140

141141
test:
142-
$(PYTHON) setup.py test
142+
$(PYTHON) -m $(PYTEST)
143143

144144
cov:
145145
(cd $(TESTDIR); $(PYTEST) -x --cov="$(PROJ)" --cov-report=html)

setup.py

-17
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import codecs
44
import os
55
import re
6-
import sys
76

87
import setuptools
9-
import setuptools.command.test
108

119
NAME = 'django-celery-beat'
1210
PACKAGE = 'django_celery_beat'
@@ -103,19 +101,6 @@ def reqs(*f):
103101

104102
# -*- %%% -*-
105103

106-
107-
class pytest(setuptools.command.test.test):
108-
user_options = [('pytest-args=', 'a', 'Arguments to pass to pytest')]
109-
110-
def initialize_options(self):
111-
setuptools.command.test.test.initialize_options(self)
112-
self.pytest_args = []
113-
114-
def run_tests(self):
115-
import pytest
116-
sys.exit(pytest.main(self.pytest_args))
117-
118-
119104
setuptools.setup(
120105
name=NAME,
121106
packages=setuptools.find_packages(exclude=[
@@ -133,8 +118,6 @@ def run_tests(self):
133118
license='BSD',
134119
python_requires='>=3.8',
135120
install_requires=reqs('default.txt') + reqs('runtime.txt'),
136-
tests_require=reqs('test.txt') + reqs('test-django.txt'),
137-
cmdclass={'test': pytest},
138121
classifiers=classifiers,
139122
entry_points={
140123
'celery.beat_schedulers': [

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ usedevelop = true
8080
commands =
8181
pip install --upgrade https://github.com/celery/celery/zipball/main#egg=celery
8282
pip install --upgrade https://github.com/celery/kombu/zipball/main#egg=kombu
83-
pip install Django
83+
pip install Django pytest
8484
pytest -x --cov=django_celery_beat --cov-report=xml --no-cov-on-fail

0 commit comments

Comments
 (0)