Skip to content

Commit a436d4a

Browse files
committed
fix tests
1 parent b91ce53 commit a436d4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/tracer/test_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22

33
import mock
4+
import pkg_resources
45

56
from ddtrace.version import get_version
67
from tests.tracer import _version # noqa: F401 -> we need to import it so that it can be swapped with the test module
@@ -21,10 +22,9 @@ def test_get_version_from_pkg_resources():
2122

2223
def test_get_version_dev_fallback():
2324
with mock.patch.dict(sys.modules, {"ddtrace._version": None}):
25+
expected_error = pkg_resources.DistributionNotFound()
2426
with mock.patch("pkg_resources.get_distribution") as mock_get_distribution:
25-
import pkg_resources
26-
27-
mock_get_distribution.side_effect = pkg_resources.DistributionNotFound()
27+
mock_get_distribution.side_effect = expected_error
2828
assert get_version() == "dev"
2929

3030

0 commit comments

Comments
 (0)