Skip to content

Commit 66e15fc

Browse files
committed
test: Only configure celery.contrib.pytest when installed
Signed-off-by: Ferenc Géczi <[email protected]>
1 parent 42c2900 commit 66e15fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# (c) Copyright IBM Corp. 2021
22
# (c) Copyright Instana Inc. 2020
33

4+
import importlib.util
45
import os
56
import sys
67
import pytest
7-
pytest_plugins = ("celery.contrib.pytest", )
8+
9+
if importlib.util.find_spec('celery'):
10+
pytest_plugins = ("celery.contrib.pytest", )
811

912
# Set our testing flags
1013
os.environ["INSTANA_TEST"] = "true"

0 commit comments

Comments
 (0)