File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import sys
22
33import mock
4+ import pkg_resources
45
56from ddtrace .version import get_version
67from 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
2223def 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
You can’t perform that action at this time.
0 commit comments