Skip to content

Commit

Permalink
chore: Remove python 3.8 syntax from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrelg committed Sep 29, 2022
1 parent a239fab commit 808122c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_log_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@pytest.fixture()
def cid():
"""Set and return a correlation ID"""
correlation_id.set(cid := uuid4().hex)
cid = uuid4().hex
correlation_id.set(cid)
return cid


Expand Down Expand Up @@ -81,7 +82,8 @@ def test_celery_filter_truncates_current_id_correctly(cid: str, log_record: LogR
Otherwise, the id should be truncated to the specified length.
"""
filter_ = CeleryTracingIdsFilter(uuid_length=uuid_length)
celery_current_id.set(celery_id := str(uuid4()))
celery_id = str(uuid4())
celery_current_id.set(celery_id)

assert not hasattr(log_record, 'celery_current_id')
filter_.filter(log_record)
Expand All @@ -94,7 +96,8 @@ def test_celery_filter_maintains_current_behavior(cid: str, log_record: LogRecor
Since the default values of CeleryTracingIdsFilter are being changed,
the new default values should also not trim a hex uuid.
"""
celery_current_id.set(celery_id := uuid4().hex)
celery_id = uuid4().hex
celery_current_id.set(celery_id)
new_filter = CeleryTracingIdsFilter()

assert not hasattr(log_record, 'celery_current_id')
Expand Down

0 comments on commit 808122c

Please sign in to comment.