Skip to content

Commit 99bc267

Browse files
chore(tests): update brittle warning log assertion (#3430) (#3433)
(cherry picked from commit 3f6bca0) Co-authored-by: Brett Langdon <[email protected]>
1 parent 4d0e4c7 commit 99bc267

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/integration/test_integration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -781,19 +781,19 @@ def test_no_warnings():
781781
# which results in a trace being generated after the tracer shutdown
782782
# has been initiated which results in a deprecation warning.
783783
env["DD_TRACE_SQLITE3_ENABLED"] = "false"
784-
out, err, status, pid = call_program("ddtrace-run", sys.executable, "-Wall", "-c", "'import ddtrace'", env=env)
784+
out, err, _, _ = call_program("ddtrace-run", sys.executable, "-Wall", "-c", "'import ddtrace'", env=env)
785785
assert out == b"", out
786786

787787
# Wrapt is using features deprecated in Python 3.10
788788
# See https://github.com/GrahamDumpleton/wrapt/issues/200
789789
if sys.version_info < (3, 10, 0):
790790
assert err == b"", err
791791
else:
792-
assert (
793-
err
794-
== (
792+
# Assert that the only log lines in the output are import warnings
793+
lines = err.splitlines()
794+
assert len(lines) > 0, err
795+
for line in lines:
796+
assert line == (
795797
b"<frozen importlib._bootstrap>:914: ImportWarning: "
796-
b"ImportHookFinder.find_spec() not found; falling back to find_module()\n"
797-
)
798-
* 75
799-
), err
798+
b"ImportHookFinder.find_spec() not found; falling back to find_module()"
799+
), err

0 commit comments

Comments
 (0)