You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable support for `pytest-bdd >= 6.1` by:
* Using `importlib_metadata` or `importlib.metadata` as necessary to
gather package version
* Switching to collection `step_func_args` after steps finish (or after
they error)
* Introducing a "safe" JSONification of `step_func_args` that catches
possible `TypeError` exceptions and returns the error in a
`json.dumps()`-safe dict
Compatibility with `pytest-bdd < 4` is maintained by moving the old
codepath to a utility function and using it whenever it looks like we
have the old-style functions available. Technically, this maintains
compatibility with `< 6.1` because that's when the latter function was
removed but, based on testing, `step_func_args` is populated as expected
in `>= 4.0` and our test suites pass for Python `3.6+`.
The backwards-compatible code is necessary because older versions of
`pytest-bdd` include fixtures in the `step_func_args` passed to the
`pytest_bdd_after_step` and `pytest_bdd_step_error`, breaking
`json.dumps()`.
Also in this change:
* Updating dependencies for testing environments
* Returning `pytest-bdd` versions in `riotfile` to their state pre #4492
.
Fixes#4492 .
## Checklist
- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](../docs/contributing.rst#release-branch-maintenance))
## Reviewer Checklist
- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](../docs/contributing.rst#release-branch-maintenance)
---------
Co-authored-by: Emmett Butler <[email protected]>
Co-authored-by: Munir Abdinur <[email protected]>
Co-authored-by: Brett Langdon <[email protected]>
0 commit comments