Closed judgeaxl closed 1 year ago
I found a solution in importlib.metadata
import importlib.metadata
version = importlib.metadata.version("pytest-bdd")
I started on a PR for this, but I'm having trouble getting the testing environment to work in WSL2. Docker complains about ports not being free and riot testing fails in multiple ways. Perhaps someone who's got the environment up and running already can grab those two lines faster than I get this to work.
This is a duplicate of #4492. However, the library documentation does not state the version support for this integration. I will fix that and then we would need to work on adding support for newer versions of pytest-bdd
.
Summary of problem
When using pytest-bdd 6.1.0 or higher, the ddtrace integration fails to find the pytest-bdd version.
The
version
property was removed from pytest-bdd in 6.1.0 in this commit pytest-dev/pytest-bdd@6f95c5cacdafc954b8d60d6fcf93227230f2623aWhich version of dd-trace-py are you using?
1.10.1
Which version of pip are you using?
22.2.2
Which libraries and their versions are you using?
`pip freeze`
ddtrace==1.10.1 pytest-bdd==6.1.1How can we reproduce your problem?
Use pytest-bdd with a version higher than 6.1.0 together with ddtrace
Reverting to pytest-bdd 6.0.1 removes the problem
What is the result that you get?
Running tests fail with:
What is the result that you expected?
No errors