Skip to content

Commit

Permalink
Set logger level
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jul 21, 2024
1 parent c548c75 commit 69ba71a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/otel_integrations/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
```
"""

import logging
from typing import Iterator

import pytest
Expand Down Expand Up @@ -35,7 +36,6 @@
@pytest.fixture
def celery_app() -> Iterator[Celery]:
app = Celery('tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0')
celery_app.conf.update(worker_hijack_root_logger=False) # type: ignore

@app.task(name='tasks.say_hello') # type: ignore
def say_hello(): # type: ignore
Expand All @@ -50,7 +50,8 @@ def say_hello(): # type: ignore

@pytest.fixture(autouse=True)
def celery_worker(celery_app: Celery) -> Iterator[WorkController]:
with start_worker(celery_app, perform_ping_check=False) as worker: # type: ignore
logger = logging.getLogger()
with start_worker(celery_app, perform_ping_check=False, loglevel=logger.level) as worker: # type: ignore
yield worker


Expand Down

0 comments on commit 69ba71a

Please sign in to comment.