Skip to content

Commit

Permalink
Add skip for Py2
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Apr 9, 2024
1 parent dd87bce commit 7609bde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/application_celery/test_celery_distributed_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import pytest

from _target_application import add, assert_dt
from testing_support.fixtures import override_application_settings
from testing_support.validators.validate_transaction_count import (
Expand All @@ -24,6 +25,10 @@

from newrelic.api.background_task import background_task

from newrelic.packages import six

skip_if_py2 = pytest.mark.skip(six.PY2, reason="Celery has no pytest plugin for Python 2, making testing very difficult.")


@pytest.fixture(scope="module")
def celery_config():
Expand All @@ -40,6 +45,7 @@ def celery_worker_parameters():
return {"shutdown_timeout": 120}


@skip_if_py2
@validate_transaction_metrics(
name="_target_application.assert_dt",
group="Celery",
Expand All @@ -64,6 +70,7 @@ def test_celery_task_distributed_tracing(celery_worker):
assert result == 1


@skip_if_py2
@override_application_settings({"distributed_tracing.enabled": False})
@validate_transaction_metrics(
name="_target_application.add",
Expand Down

0 comments on commit 7609bde

Please sign in to comment.