Skip to content

Commit

Permalink
Update test suite to use pytest, remove related in setup.py (celery#771)
Browse files Browse the repository at this point in the history
* 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>
(cherry picked from commit a50011d)
  • Loading branch information
kwongtn authored and daniilr committed Jul 29, 2024
1 parent f5eb928 commit aecfe83
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ test-all: clean-pyc
$(TOX)

test:
$(PYTHON) setup.py test
$(PYTHON) -m $(PYTEST)

cov:
(cd $(TESTDIR); $(PYTEST) -x --cov="$(PROJ)" --cov-report=html)
Expand Down
17 changes: 0 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import codecs
import os
import re
import sys

import setuptools
import setuptools.command.test

try:
import platform
Expand Down Expand Up @@ -119,19 +117,6 @@ def reqs(*f):

# -*- %%% -*-


class pytest(setuptools.command.test.test):
user_options = [('pytest-args=', 'a', 'Arguments to pass to pytest')]

def initialize_options(self):
setuptools.command.test.test.initialize_options(self)
self.pytest_args = []

def run_tests(self):
import pytest
sys.exit(pytest.main(self.pytest_args))


setuptools.setup(
name=NAME,
packages=setuptools.find_packages(exclude=[
Expand All @@ -148,8 +133,6 @@ def run_tests(self):
platforms=['any'],
license='BSD',
install_requires=reqs('default.txt') + reqs('runtime.txt'),
tests_require=reqs('test.txt') + reqs('test-django.txt'),
cmdclass={'test': pytest},
classifiers=classifiers,
entry_points={
'celery.beat_schedulers': [
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ usedevelop = true
commands =
pip install --upgrade https://github.com/celery/celery/zipball/main#egg=celery
pip install --upgrade https://github.com/celery/kombu/zipball/main#egg=kombu
pip install Django
pip install Django pytest
pytest -x --cov=django_celery_beat --cov-report=xml --no-cov-on-fail

0 comments on commit aecfe83

Please sign in to comment.