Skip to content

Commit

Permalink
Do not censor Skip Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sternakt committed Jan 21, 2025
1 parent a2805e7 commit e4da465
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Any, Optional

import pytest
from _pytest.outcomes import Skipped
from pytest import CallInfo, Item

import autogen
Expand Down Expand Up @@ -135,7 +136,13 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[Any]) -> None:
This is called after each test call.
"""
if call.excinfo is not None: # This means the test failed
original_message = "".join([repr(arg) for arg in call.excinfo.value.args])
exception_value = call.excinfo.value

original_message = "".join([repr(arg) for arg in exception_value.args])

# Check if this exception is a pytest skip exception
if isinstance(exception_value, Skipped):
return # Don't modify skip exceptions

if Secrets.needs_sanitizing(original_message):
censored_exception = CensoredError(call.excinfo.value)
Expand Down

0 comments on commit e4da465

Please sign in to comment.