Skip to content

Commit 9614a34

Browse files
chore(tests): update brittle warning log assertion (#3430) (#3431)
(cherry picked from commit 3f6bca0) Co-authored-by: Brett Langdon <[email protected]>
1 parent a0b68fd commit 9614a34

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
@@ -783,19 +783,19 @@ def test_no_warnings():
783783
# which results in a trace being generated after the tracer shutdown
784784
# has been initiated which results in a deprecation warning.
785785
env["DD_TRACE_SQLITE3_ENABLED"] = "false"
786-
out, err, status, pid = call_program("ddtrace-run", sys.executable, "-Wall", "-c", "'import ddtrace'", env=env)
786+
out, err, _, _ = call_program("ddtrace-run", sys.executable, "-Wall", "-c", "'import ddtrace'", env=env)
787787
assert out == b"", out
788788

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

0 commit comments

Comments
 (0)