Skip to content

Commit 04da476

Browse files
authored
chore(sanic): ensure sanic tests ignore the http.useragent tag in snapshots [backport #4907 to 1.7] (#4908)
## Description Backport of #4907 to 1.7 The user agent used in testing may change as the version of `requests` being used changes. This change ensure that we do not consider the `http.useragent` tag value in the snapshots for the sanic tests. ## Checklist - [ ] Followed the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines) when writing a release note. - [ ] Add additional sections for `feat` and `fix` pull requests. - [ ] [Library documentation](https://github.com/DataDog/dd-trace-py/tree/1.x/docs) and/or [Datadog's documentation site](https://github.com/DataDog/documentation/) is updated. Link to doc PR in description. ## Reviewer Checklist - [ ] Title is accurate. - [ ] Description motivates each change. - [ ] No unnecessary changes were introduced in this PR. - [ ] Avoid breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Tests provided or description of manual testing performed is included in the code or PR. - [ ] Release note has been added and follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines), or else `changelog/no-changelog` label added. - [ ] All relevant GitHub issues are correctly linked. - [ ] Backports are identified and tagged with Mergifyio.
1 parent 87b1aee commit 04da476

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/contrib/sanic/test_sanic_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def sanic_client():
4040

4141

4242
@pytest.mark.snapshot(
43+
ignores=["meta.http.useragent"],
4344
variants={
4445
"": sanic_version >= (21, 9, 0),
4546
"pre_21.9": sanic_version < (21, 9, 0),
@@ -56,7 +57,7 @@ def assert_response(response):
5657

5758

5859
@pytest.mark.snapshot(
59-
ignores=["meta.error.stack"],
60+
ignores=["meta.error.stack", "meta.http.useragent"],
6061
variants={
6162
"": sanic_version >= (21, 9, 0),
6263
"pre_21.9": sanic_version < (21, 9, 0),

0 commit comments

Comments
 (0)