File move-pytest-configuration-to-conftest.patch of Package python-celery
Index: celery-5.3.6/celery/contrib/pytest.py
===================================================================
--- celery-5.3.6.orig/celery/contrib/pytest.py
+++ celery-5.3.6/celery/contrib/pytest.py
@@ -19,16 +19,6 @@ NO_WORKER = os.environ.get('NO_WORKER')
# Well, they're called fixtures....
-def pytest_configure(config):
- """Register additional pytest configuration."""
- # add the pytest.mark.celery() marker registration to the pytest.ini [markers] section
- # this prevents pytest 4.5 and newer from issuing a warning about an unknown marker
- # and shows helpful marker documentation when running pytest --markers.
- config.addinivalue_line(
- "markers", "celery(**overrides): override celery configuration for a test case"
- )
-
-
@contextmanager
def _create_app(enable_logging=False,
use_trap=False,
Index: celery-5.3.6/t/unit/conftest.py
===================================================================
--- celery-5.3.6.orig/t/unit/conftest.py
+++ celery-5.3.6/t/unit/conftest.py
@@ -56,6 +56,16 @@ class WhateverIO(io.StringIO):
_SIO_write(self, data.decode() if isinstance(data, bytes) else data)
+def pytest_configure(config):
+ """Register additional pytest configuration."""
+ # add the pytest.mark.celery() marker registration to the pytest.ini [markers] section
+ # this prevents pytest 4.5 and newer from issueing a warning about an unknown marker
+ # and shows helpful marker documentation when running pytest --markers.
+ config.addinivalue_line(
+ "markers", "celery(**overrides): override celery configuration for a test case"
+ )
+
+
@pytest.fixture(scope='session')
def celery_config():
return {