CI: update all test reports (HTML, XML, JSON, MD)

This commit is contained in:
ci-bot
2025-07-15 12:23:32 +00:00
parent b080250370
commit 37c62ba23d
6 changed files with 2296 additions and 227 deletions
+319
View File
@@ -0,0 +1,319 @@
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #e6e6e6;
vertical-align: top;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
#environment ul {
margin: 0;
padding: 0 20px;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed,
.passed .col-result {
color: green;
}
span.skipped,
span.xfailed,
span.rerun,
.skipped .col-result,
.xfailed .col-result,
.rerun .col-result {
color: orange;
}
span.error,
span.failed,
span.xpassed,
.error .col-result,
.failed .col-result,
.xpassed .col-result {
color: red;
}
.col-links__extra {
margin-right: 3px;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%;
}
#results-table th,
#results-table td {
padding: 5px;
border: 1px solid #e6e6e6;
text-align: left;
}
#results-table th {
font-weight: bold;
}
/*------------------
* 2. Extra
*------------------*/
.logwrapper {
max-height: 230px;
overflow-y: scroll;
background-color: #e6e6e6;
}
.logwrapper.expanded {
max-height: none;
}
.logwrapper.expanded .logexpander:after {
content: "collapse [-]";
}
.logwrapper .logexpander {
z-index: 1;
position: sticky;
top: 10px;
width: max-content;
border: 1px solid;
border-radius: 3px;
padding: 5px 7px;
margin: 10px 0 10px calc(100% - 80px);
cursor: pointer;
background-color: #e6e6e6;
}
.logwrapper .logexpander:after {
content: "expand [+]";
}
.logwrapper .logexpander:hover {
color: #000;
border-color: #000;
}
.logwrapper .log {
min-height: 40px;
position: relative;
top: -50px;
height: calc(100% + 50px);
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
padding: 5px;
padding-right: 80px;
white-space: pre-wrap;
}
div.media {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin: 0 5px;
overflow: hidden;
width: 320px;
}
.media-container {
display: grid;
grid-template-columns: 25px auto 25px;
align-items: center;
flex: 1 1;
overflow: hidden;
height: 200px;
}
.media-container--fullscreen {
grid-template-columns: 0px auto 0px;
}
.media-container__nav--right,
.media-container__nav--left {
text-align: center;
cursor: pointer;
}
.media-container__viewport {
cursor: pointer;
text-align: center;
height: inherit;
}
.media-container__viewport img,
.media-container__viewport video {
object-fit: cover;
width: 100%;
max-height: 100%;
}
.media__name,
.media__counter {
display: flex;
flex-direction: row;
justify-content: space-around;
flex: 0 0 25px;
align-items: center;
}
.collapsible td:not(.col-links) {
cursor: pointer;
}
.collapsible td:not(.col-links):hover::after {
color: #bbb;
font-style: italic;
cursor: pointer;
}
.col-result {
width: 130px;
}
.col-result:hover::after {
content: " (hide details)";
}
.col-result.collapsed:hover::after {
content: " (show details)";
}
#environment-header h2:hover::after {
content: " (hide details)";
color: #bbb;
font-style: italic;
cursor: pointer;
font-size: 12px;
}
#environment-header.collapsed h2:hover::after {
content: " (show details)";
color: #bbb;
font-style: italic;
cursor: pointer;
font-size: 12px;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sortable.desc:after {
content: " ";
position: relative;
left: 5px;
bottom: -12.5px;
border: 10px solid #4caf50;
border-bottom: 0;
border-left-color: transparent;
border-right-color: transparent;
}
.sortable.asc:after {
content: " ";
position: relative;
left: 5px;
bottom: 12.5px;
border: 10px solid #4caf50;
border-top: 0;
border-left-color: transparent;
border-right-color: transparent;
}
.hidden, .summary__reload__button.hidden {
display: none;
}
.summary__data {
flex: 0 0 550px;
}
.summary__reload {
flex: 1 1;
display: flex;
justify-content: center;
}
.summary__reload__button {
flex: 0 0 300px;
display: flex;
color: white;
font-weight: bold;
background-color: #4caf50;
text-align: center;
justify-content: center;
align-items: center;
border-radius: 3px;
cursor: pointer;
}
.summary__reload__button:hover {
background-color: #46a049;
}
.summary__spacer {
flex: 0 0 550px;
}
.controls {
display: flex;
justify-content: space-between;
}
.filters,
.collapse {
display: flex;
align-items: center;
}
.filters button,
.collapse button {
color: #999;
border: none;
background: none;
cursor: pointer;
text-decoration: underline;
}
.filters button:hover,
.collapse button:hover {
color: #ccc;
}
.filter__label {
margin-right: 10px;
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+560 -4
View File
@@ -1,5 +1,561 @@
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --result-log=ci-reports/markdown/pytest-result.log
inifile: None
rootdir: /workspace/tligui_y/slic
============================= test session starts ==============================
platform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0
rootdir: /workspace/tligui_y/slic
plugins: metadata-3.1.1, cov-5.0.0, allure-pytest-2.13.5, html-4.1.1, md-report-0.6.2, json-report-1.5.0
collected 50 items / 2 errors
tests/test_io_utils.py ..FFFFFF.F
tests/test_math_utils.py FF........FFxFFFFFFFFFFFFFFFFFF
tests/test_string_utils.py .F..FF.x
==================================== ERRORS ====================================
__________________ ERROR collecting tests/test_broken_fct.py ___________________
.pixi/envs/default/lib/python3.8/site-packages/_pytest/python.py:493: in importtestmodule
mod = import_path(
.pixi/envs/default/lib/python3.8/site-packages/_pytest/pathlib.py:587: in import_path
importlib.import_module(module_name)
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:175: in exec_module
source_stat, co = _rewrite_test(fn, self.config)
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:355: in _rewrite_test
tree = ast.parse(source, filename=strfn)
.pixi/envs/default/lib/python3.8/ast.py:47: in parse
return compile(source, filename, mode, flags,
E File "/workspace/tligui_y/slic/tests/test_broken_fct.py", line 8
E def test_valid_2():
E ^
E SyntaxError: invalid syntax
________________ ERROR collecting tests/test_collector_error.py ________________
ImportError while importing test module '/workspace/tligui_y/slic/tests/test_collector_error.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_collector_error.py:1: in <module>
from no_existing_module.math_utils import *
E ModuleNotFoundError: No module named 'no_existing_module'
=================================== FAILURES ===================================
_____________________________ test_cause_io_error ______________________________
def test_cause_io_error():
# Raises manual IOError to simulate IO failure
> cause_io_error()
tests/test_io_utils.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def cause_io_error():
> raise IOError("Forced IO Error for testing")
E OSError: Forced IO Error for testing
functions/io_utils.py:10: OSError
_____________________________ test_file_not_found ______________________________
def test_file_not_found():
# Reading non-existing file raises FileNotFoundError
> read_file("nonexistent.file")
tests/test_io_utils.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'nonexistent.file'
def read_file(path):
> with open(path, "r", encoding="utf-8") as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
functions/io_utils.py:2: FileNotFoundError
____________________________ test_permission_error _____________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74aa6040>
def test_permission_error(monkeypatch):
# Patch open to raise PermissionError simulating access denial
def raise_perm_error(*args, **kwargs):
raise PermissionError("Permission denied")
monkeypatch.setattr("builtins.open", raise_perm_error)
> read_file("anyfile.txt")
tests/test_io_utils.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
functions/io_utils.py:2: in read_file
with open(path, "r", encoding="utf-8") as f:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = ('anyfile.txt', 'r'), kwargs = {'encoding': 'utf-8'}
def raise_perm_error(*args, **kwargs):
> raise PermissionError("Permission denied")
E PermissionError: Permission denied
tests/test_io_utils.py:34: PermissionError
_____________________________ test_mock_open_error _____________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74c95280>
def test_mock_open_error(monkeypatch):
# Mock open() to raise IOError simulating read error
mocked_open = mock.mock_open()
mocked_open.side_effect = IOError("Mocked IOError")
monkeypatch.setattr("builtins.open", mocked_open)
> with open("file.txt", "r") as f:
tests/test_io_utils.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/unittest/mock.py:1081: in __call__
return self._mock_call(*args, **kwargs)
.pixi/envs/default/lib/python3.8/unittest/mock.py:1085: in _mock_call
return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='open' spec='builtin_function_or_method' id='140116677448752'>
args = ('file.txt', 'r'), kwargs = {}, effect = OSError('Mocked IOError')
def _execute_mock_call(self, /, *args, **kwargs):
# separate from _increment_mock_call so that awaited functions are
# executed separately from their call, also AsyncMock overrides this method
effect = self.side_effect
if effect is not None:
if _is_exception(effect):
> raise effect
E OSError: Mocked IOError
.pixi/envs/default/lib/python3.8/unittest/mock.py:1140: OSError
________________________ test_file_handle_closed_error _________________________
def test_file_handle_closed_error():
# Accessing closed file raises ValueError
f = io.StringIO("content")
f.close()
> f.read()
E ValueError: I/O operation on closed file
tests/test_io_utils.py:50: ValueError
________________________________ test_os_error _________________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74ce8100>
def test_os_error(monkeypatch):
# Patch os.remove to raise OSError simulating filesystem error
def raise_os_error(path):
raise OSError("Simulated OSError")
monkeypatch.setattr("os.remove", raise_os_error)
> os.remove("file.txt")
tests/test_io_utils.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'file.txt'
def raise_os_error(path):
> raise OSError("Simulated OSError")
E OSError: Simulated OSError
tests/test_io_utils.py:55: OSError
__________________________ test_file_not_found_error ___________________________
def test_file_not_found_error():
# Raises FileNotFoundError when opening a non-existent file
> open("no_such_file.txt", "r")
E FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
tests/test_io_utils.py:69: FileNotFoundError
_________________________________ test_broken __________________________________
def test_broken():
# simulating a broken or faulty test implementation that will cause the test to error
> want_the_test_to_fail
E NameError: name 'want_the_test_to_fail' is not defined
tests/test_math_utils.py:16: NameError
__________________________ test_call_missing_function __________________________
def test_call_missing_function():
# Accessing a missing function attribute raises AttributeError
> getattr(math_utils, "non_existent_function")()
E AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
tests/test_math_utils.py:20: AttributeError
______________________________ test_addition_fail ______________________________
def test_addition_fail():
# Assertion failure: expected incorrect result
> assert addition(2, 2) == 5
E assert 4 == 5
E + where 4 = addition(2, 2)
tests/test_math_utils.py:48: AssertionError
______________________________ test_division_zero ______________________________
def test_division_zero():
# Will raise ZeroDivisionError if not handled in division
> division(1, 0)
tests/test_math_utils.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = 1, b = 0
def division(a, b):
> return a / b
E ZeroDivisionError: division by zero
functions/math_utils.py:5: ZeroDivisionError
______________________________ test_runtime_error ______________________________
def test_runtime_error():
# Test raises an uncaught RuntimeError
> raise RuntimeError("Forced runtime error")
E RuntimeError: Forced runtime error
tests/test_math_utils.py:61: RuntimeError
______________________________ test_memory_error _______________________________
def test_memory_error():
# Manually raise MemoryError to simulate out-of-memory condition
> raise MemoryError("Simulated memory error")
E MemoryError: Simulated memory error
tests/test_math_utils.py:65: MemoryError
______________________________ test_timeout_error ______________________________
def test_timeout_error():
# Manually raise TimeoutError simulating timeout conditions
> raise TimeoutError("Simulated timeout error")
E TimeoutError: Simulated timeout error
tests/test_math_utils.py:69: TimeoutError
_____________________________ test_recursion_error _____________________________
def test_recursion_error():
# Infinite recursion triggers RecursionError
def recursive():
return recursive()
> recursive()
tests/test_math_utils.py:75:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_math_utils.py:74: in recursive
return recursive()
tests/test_math_utils.py:74: in recursive
return recursive()
E RecursionError: maximum recursion depth exceeded
!!! Recursion detected (same locals & position)
__________________________ test_floating_point_error ___________________________
def test_floating_point_error():
# Manually raise FloatingPointError (rare in practice)
> raise FloatingPointError("Simulated floating point error")
E FloatingPointError: Simulated floating point error
tests/test_math_utils.py:79: FloatingPointError
_________________________ test_floating_point_overflow _________________________
def test_floating_point_overflow():
# Exponential overflow triggers OverflowError
> math.exp(1000)
E OverflowError: math range error
tests/test_math_utils.py:83: OverflowError
_______________________________ test_value_error _______________________________
def test_value_error():
# ValueError on invalid integer conversion
> int("invalid")
E ValueError: invalid literal for int() with base 10: 'invalid'
tests/test_math_utils.py:87: ValueError
_______________________________ test_type_error ________________________________
def test_type_error():
# TypeError when passing wrong argument type to sum
> sum(5)
E TypeError: 'int' object is not iterable
tests/test_math_utils.py:91: TypeError
___________________________ test_unhandled_exception ___________________________
def test_unhandled_exception():
# Raises generic unhandled Exception
> raise Exception("Generic unhandled exception")
E Exception: Generic unhandled exception
tests/test_math_utils.py:95: Exception
______________________________ test_custom_error _______________________________
def test_custom_error():
# Raises user-defined CustomError exception
> raise CustomError("Custom error simulation")
E test_math_utils.CustomError: Custom error simulation
tests/test_math_utils.py:99: CustomError
__________________________ test_stop_iteration_direct __________________________
def test_stop_iteration_direct():
# Directly raise StopIteration exception
> raise StopIteration()
E StopIteration
tests/test_math_utils.py:103: StopIteration
The above exception was the direct cause of the following exception:
cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x7f6f74900550>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(
cls,
func: Callable[[], TResult],
when: Literal["collect", "setup", "call", "teardown"],
reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
) -> CallInfo[TResult]:
"""Call func, wrapping the result in a CallInfo.
:param func:
The function to call. Called without arguments.
:type func: Callable[[], _pytest.runner.TResult]
:param when:
The phase in which the function is called.
:param reraise:
Exception or exceptions that shall propagate if raised by the
function, instead of being wrapped in the CallInfo.
"""
excinfo = None
start = timing.time()
precise_start = timing.perf_counter()
try:
> result: TResult | None = func()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:242: in <lambda>
lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_hooks.py:513: in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_manager.py:120: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
yield from thread_exception_runtest_hook()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
yield
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
yield
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:846: in pytest_runtest_call
yield from self._runtest_for(item, "call")
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:829: in _runtest_for
yield
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CaptureManager _method='no' _global_capturing=<MultiCapture out=None err=None in_=None _state='suspended' _in_suspended=False> _capture_fixture=None>
item = <Function test_stop_iteration_direct>
@hookimpl(wrapper=True)
def pytest_runtest_call(self, item: Item) -> Generator[None]:
with self.item_capture("call", item):
> return (yield)
E RuntimeError: generator raised StopIteration
.pixi/envs/default/lib/python3.8/site-packages/_pytest/capture.py:880: RuntimeError
__________________________ test_generator_exit_direct __________________________
def test_generator_exit_direct():
# Directly raise GeneratorExit exception
> raise GeneratorExit()
E GeneratorExit
tests/test_math_utils.py:107: GeneratorExit
_____________________________ test_recursion_limit _____________________________
def test_recursion_limit():
# Lower recursion limit to force RecursionError on deep recursion
original_limit = sys.getrecursionlimit()
> sys.setrecursionlimit(50)
E RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
tests/test_math_utils.py:112: RecursionError
_____________________________ test_malformed_code ______________________________
def test_malformed_code():
# SyntaxError when executing malformed Python code
> exec("def bad(:\n pass")
E File "<string>", line 1
E def bad(:
E ^
E SyntaxError: invalid syntax
tests/test_math_utils.py:122: SyntaxError
________________________________ test_sys_exit _________________________________
def test_sys_exit():
# Simulate SystemExit via sys.exit
> sys.exit(1)
E SystemExit: 1
tests/test_math_utils.py:126: SystemExit
_____________________________ test_broken_function _____________________________
def test_broken_function():
# Simulate broken function raising TypeError
def broken_func(*args, **kwargs):
raise TypeError("Broken function")
> broken_func()
tests/test_math_utils.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
def broken_func(*args, **kwargs):
> raise TypeError("Broken function")
E TypeError: Broken function
tests/test_math_utils.py:131: TypeError
___________________________ test_import_error_patch ____________________________
def test_import_error_patch():
# Patch import to simulate ImportError on specific module
original_import = __import__
def fake_import(name, *args, **kwargs):
if name == "fake_module":
raise ImportError("Simulated ImportError")
return original_import(name, *args, **kwargs)
import builtins
builtins.__import__, old_import = fake_import, builtins.__import__
try:
> __import__("fake_module")
tests/test_math_utils.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'fake_module', args = (), kwargs = {}
def fake_import(name, *args, **kwargs):
if name == "fake_module":
> raise ImportError("Simulated ImportError")
E ImportError: Simulated ImportError
tests/test_math_utils.py:139: ImportError
_________________________ test_module_not_found_error __________________________
def test_module_not_found_error():
# Raises ModuleNotFoundError (subclass of ImportError) for missing module
> importlib.import_module("non_existent_module_xyz")
tests/test_math_utils.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'non_existent_module_xyz'
import_ = <function _gcd_import at 0x7f6f793954c0>
> ???
E ModuleNotFoundError: No module named 'non_existent_module_xyz'
<frozen importlib._bootstrap>:973: ModuleNotFoundError
__________________________ test_uppercase_type_error ___________________________
def test_uppercase_type_error():
# TypeError when input is None (invalid input)
> uppercase(None)
tests/test_string_utils.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
s = None
def uppercase(s):
if s is None:
> raise TypeError("Input cannot be None")
E TypeError: Input cannot be None
functions/string_utils.py:3: TypeError
__________________________ test_unicode_decode_error ___________________________
def test_unicode_decode_error():
# UnicodeDecodeError when decoding invalid byte sequence
> b'\xff'.decode('utf-8')
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
tests/test_string_utils.py:26: UnicodeDecodeError
_____________________ test_unicode_decode_surrogateescape ______________________
def test_unicode_decode_surrogateescape():
# UnicodeDecodeError with strict error handler on invalid byte
> b"\x80".decode("utf-8", errors="strict")
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
tests/test_string_utils.py:30: UnicodeDecodeError
=============================== warnings summary ===============================
tests/test_string_utils.py::test_warning_emit
/workspace/tligui_y/slic/tests/test_string_utils.py:22: UserWarning: Test warning
warnings.warn("Test warning", UserWarning)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- generated xml file: /workspace/tligui_y/slic/ci-reports/xml/pytest-report.xml -
--------------------------------- JSON report ----------------------------------
report saved to: ci-reports/markdown/pytest-report.json
- Generated html report: file:///workspace/tligui_y/slic/ci-reports/html/pytest-report.html -
=========================== short test summary info ============================
FAILED tests/test_io_utils.py::test_cause_io_error - OSError: Forced IO Error for testing
FAILED tests/test_io_utils.py::test_file_not_found - FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
FAILED tests/test_io_utils.py::test_permission_error - PermissionError: Permission denied
FAILED tests/test_io_utils.py::test_mock_open_error - OSError: Mocked IOError
FAILED tests/test_io_utils.py::test_file_handle_closed_error - ValueError: I/O operation on closed file
FAILED tests/test_io_utils.py::test_os_error - OSError: Simulated OSError
FAILED tests/test_io_utils.py::test_file_not_found_error - FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
FAILED tests/test_math_utils.py::test_broken - NameError: name 'want_the_test_to_fail' is not defined
FAILED tests/test_math_utils.py::test_call_missing_function - AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
FAILED tests/test_math_utils.py::test_addition_fail - assert 4 == 5
+ where 4 = addition(2, 2)
FAILED tests/test_math_utils.py::test_division_zero - ZeroDivisionError: division by zero
FAILED tests/test_math_utils.py::test_runtime_error - RuntimeError: Forced runtime error
FAILED tests/test_math_utils.py::test_memory_error - MemoryError: Simulated memory error
FAILED tests/test_math_utils.py::test_timeout_error - TimeoutError: Simulated timeout error
FAILED tests/test_math_utils.py::test_recursion_error - RecursionError: maximum recursion depth exceeded
FAILED tests/test_math_utils.py::test_floating_point_error - FloatingPointError: Simulated floating point error
FAILED tests/test_math_utils.py::test_floating_point_overflow - OverflowError: math range error
FAILED tests/test_math_utils.py::test_value_error - ValueError: invalid literal for int() with base 10: 'invalid'
FAILED tests/test_math_utils.py::test_type_error - TypeError: 'int' object is not iterable
FAILED tests/test_math_utils.py::test_unhandled_exception - Exception: Generic unhandled exception
FAILED tests/test_math_utils.py::test_custom_error - test_math_utils.CustomError: Custom error simulation
FAILED tests/test_math_utils.py::test_stop_iteration_direct - RuntimeError: generator raised StopIteration
FAILED tests/test_math_utils.py::test_generator_exit_direct - GeneratorExit
FAILED tests/test_math_utils.py::test_recursion_limit - RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
FAILED tests/test_math_utils.py::test_malformed_code - File "<string>", line 1
def bad(:
^
SyntaxError: invalid syntax
FAILED tests/test_math_utils.py::test_sys_exit - SystemExit: 1
FAILED tests/test_math_utils.py::test_broken_function - TypeError: Broken function
FAILED tests/test_math_utils.py::test_import_error_patch - ImportError: Simulated ImportError
FAILED tests/test_math_utils.py::test_module_not_found_error - ModuleNotFoundError: No module named 'non_existent_module_xyz'
FAILED tests/test_string_utils.py::test_uppercase_type_error - TypeError: Input cannot be None
FAILED tests/test_string_utils.py::test_unicode_decode_error - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
FAILED tests/test_string_utils.py::test_unicode_decode_surrogateescape - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
ERROR tests/test_broken_fct.py
ERROR tests/test_collector_error.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/workspace/tligui_y/slic/tests/test_string_utils.py:43: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --full-trace)
======== 32 failed, 15 passed, 2 xfailed, 1 warning, 2 errors in 0.60s =========
+397
View File
@@ -0,0 +1,397 @@
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="2" failures="32" skipped="2" tests="51" time="0.598" timestamp="2025-07-15T12:23:31.580455+00:00" hostname="534a60d2a21f"><testcase classname="" name="tests.test_broken_fct" time="0.000"><error message="collection failure">.pixi/envs/default/lib/python3.8/site-packages/_pytest/python.py:493: in importtestmodule
mod = import_path(
.pixi/envs/default/lib/python3.8/site-packages/_pytest/pathlib.py:587: in import_path
importlib.import_module(module_name)
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
???
&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked
???
&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked
???
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:175: in exec_module
source_stat, co = _rewrite_test(fn, self.config)
.pixi/envs/default/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:355: in _rewrite_test
tree = ast.parse(source, filename=strfn)
.pixi/envs/default/lib/python3.8/ast.py:47: in parse
return compile(source, filename, mode, flags,
E File "/workspace/tligui_y/slic/tests/test_broken_fct.py", line 8
E def test_valid_2():
E ^
E SyntaxError: invalid syntax</error></testcase><testcase classname="" name="tests.test_collector_error" time="0.000"><error message="collection failure">ImportError while importing test module '/workspace/tligui_y/slic/tests/test_collector_error.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_collector_error.py:1: in &lt;module&gt;
from no_existing_module.math_utils import *
E ModuleNotFoundError: No module named 'no_existing_module'</error></testcase><testcase classname="tests.test_io_utils" name="test_read_file" time="0.003" /><testcase classname="tests.test_io_utils" name="test_write_file" time="0.001" /><testcase classname="tests.test_io_utils" name="test_cause_io_error" time="0.000"><failure message="OSError: Forced IO Error for testing">def test_cause_io_error():
# Raises manual IOError to simulate IO failure
&gt; cause_io_error()
tests/test_io_utils.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def cause_io_error():
&gt; raise IOError("Forced IO Error for testing")
E OSError: Forced IO Error for testing
functions/io_utils.py:10: OSError</failure></testcase><testcase classname="tests.test_io_utils" name="test_file_not_found" time="0.000"><failure message="FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'">def test_file_not_found():
# Reading non-existing file raises FileNotFoundError
&gt; read_file("nonexistent.file")
tests/test_io_utils.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'nonexistent.file'
def read_file(path):
&gt; with open(path, "r", encoding="utf-8") as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent.file'
functions/io_utils.py:2: FileNotFoundError</failure></testcase><testcase classname="tests.test_io_utils" name="test_permission_error" time="0.000"><failure message="PermissionError: Permission denied">monkeypatch = &lt;_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74aa6040&gt;
def test_permission_error(monkeypatch):
# Patch open to raise PermissionError simulating access denial
def raise_perm_error(*args, **kwargs):
raise PermissionError("Permission denied")
monkeypatch.setattr("builtins.open", raise_perm_error)
&gt; read_file("anyfile.txt")
tests/test_io_utils.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
functions/io_utils.py:2: in read_file
with open(path, "r", encoding="utf-8") as f:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = ('anyfile.txt', 'r'), kwargs = {'encoding': 'utf-8'}
def raise_perm_error(*args, **kwargs):
&gt; raise PermissionError("Permission denied")
E PermissionError: Permission denied
tests/test_io_utils.py:34: PermissionError</failure></testcase><testcase classname="tests.test_io_utils" name="test_mock_open_error" time="0.003"><failure message="OSError: Mocked IOError">monkeypatch = &lt;_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74c95280&gt;
def test_mock_open_error(monkeypatch):
# Mock open() to raise IOError simulating read error
mocked_open = mock.mock_open()
mocked_open.side_effect = IOError("Mocked IOError")
monkeypatch.setattr("builtins.open", mocked_open)
&gt; with open("file.txt", "r") as f:
tests/test_io_utils.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/unittest/mock.py:1081: in __call__
return self._mock_call(*args, **kwargs)
.pixi/envs/default/lib/python3.8/unittest/mock.py:1085: in _mock_call
return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;MagicMock name='open' spec='builtin_function_or_method' id='140116677448752'&gt;
args = ('file.txt', 'r'), kwargs = {}, effect = OSError('Mocked IOError')
def _execute_mock_call(self, /, *args, **kwargs):
# separate from _increment_mock_call so that awaited functions are
# executed separately from their call, also AsyncMock overrides this method
effect = self.side_effect
if effect is not None:
if _is_exception(effect):
&gt; raise effect
E OSError: Mocked IOError
.pixi/envs/default/lib/python3.8/unittest/mock.py:1140: OSError</failure></testcase><testcase classname="tests.test_io_utils" name="test_file_handle_closed_error" time="0.000"><failure message="ValueError: I/O operation on closed file">def test_file_handle_closed_error():
# Accessing closed file raises ValueError
f = io.StringIO("content")
f.close()
&gt; f.read()
E ValueError: I/O operation on closed file
tests/test_io_utils.py:50: ValueError</failure></testcase><testcase classname="tests.test_io_utils" name="test_os_error" time="0.000"><failure message="OSError: Simulated OSError">monkeypatch = &lt;_pytest.monkeypatch.MonkeyPatch object at 0x7f6f74ce8100&gt;
def test_os_error(monkeypatch):
# Patch os.remove to raise OSError simulating filesystem error
def raise_os_error(path):
raise OSError("Simulated OSError")
monkeypatch.setattr("os.remove", raise_os_error)
&gt; os.remove("file.txt")
tests/test_io_utils.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'file.txt'
def raise_os_error(path):
&gt; raise OSError("Simulated OSError")
E OSError: Simulated OSError
tests/test_io_utils.py:55: OSError</failure></testcase><testcase classname="tests.test_io_utils" name="test_write_file_readonly" time="0.002" /><testcase classname="tests.test_io_utils" name="test_file_not_found_error" time="0.000"><failure message="FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'">def test_file_not_found_error():
# Raises FileNotFoundError when opening a non-existent file
&gt; open("no_such_file.txt", "r")
E FileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.txt'
tests/test_io_utils.py:69: FileNotFoundError</failure></testcase><testcase classname="tests.test_math_utils" name="test_broken" time="0.000"><failure message="NameError: name 'want_the_test_to_fail' is not defined">def test_broken():
# simulating a broken or faulty test implementation that will cause the test to error
&gt; want_the_test_to_fail
E NameError: name 'want_the_test_to_fail' is not defined
tests/test_math_utils.py:16: NameError</failure></testcase><testcase classname="tests.test_math_utils" name="test_call_missing_function" time="0.000"><failure message="AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'">def test_call_missing_function():
# Accessing a missing function attribute raises AttributeError
&gt; getattr(math_utils, "non_existent_function")()
E AttributeError: module 'functions.math_utils' has no attribute 'non_existent_function'
tests/test_math_utils.py:20: AttributeError</failure></testcase><testcase classname="tests.test_math_utils" name="test_addition_pass[2-2-4]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass[1-5-6]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass[3-4-7]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass[3-5-8]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass[3-6-9]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass_id[a=2,b=2,expected=4]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass_id[a=1,b=5,expected=6]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_pass_id[a=3,b=4,expected=7]" time="0.000" /><testcase classname="tests.test_math_utils" name="test_addition_fail" time="0.000"><failure message="assert 4 == 5&#10; + where 4 = addition(2, 2)">def test_addition_fail():
# Assertion failure: expected incorrect result
&gt; assert addition(2, 2) == 5
E assert 4 == 5
E + where 4 = addition(2, 2)
tests/test_math_utils.py:48: AssertionError</failure></testcase><testcase classname="tests.test_math_utils" name="test_division_zero" time="0.000"><failure message="ZeroDivisionError: division by zero">def test_division_zero():
# Will raise ZeroDivisionError if not handled in division
&gt; division(1, 0)
tests/test_math_utils.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = 1, b = 0
def division(a, b):
&gt; return a / b
E ZeroDivisionError: division by zero
functions/math_utils.py:5: ZeroDivisionError</failure></testcase><testcase classname="tests.test_math_utils" name="test_multiply_xfail" time="0.000"><skipped type="pytest.xfail" message="Expected failure" /></testcase><testcase classname="tests.test_math_utils" name="test_runtime_error" time="0.000"><failure message="RuntimeError: Forced runtime error">def test_runtime_error():
# Test raises an uncaught RuntimeError
&gt; raise RuntimeError("Forced runtime error")
E RuntimeError: Forced runtime error
tests/test_math_utils.py:61: RuntimeError</failure></testcase><testcase classname="tests.test_math_utils" name="test_memory_error" time="0.000"><failure message="MemoryError: Simulated memory error">def test_memory_error():
# Manually raise MemoryError to simulate out-of-memory condition
&gt; raise MemoryError("Simulated memory error")
E MemoryError: Simulated memory error
tests/test_math_utils.py:65: MemoryError</failure></testcase><testcase classname="tests.test_math_utils" name="test_timeout_error" time="0.000"><failure message="TimeoutError: Simulated timeout error">def test_timeout_error():
# Manually raise TimeoutError simulating timeout conditions
&gt; raise TimeoutError("Simulated timeout error")
E TimeoutError: Simulated timeout error
tests/test_math_utils.py:69: TimeoutError</failure></testcase><testcase classname="tests.test_math_utils" name="test_recursion_error" time="0.001"><failure message="RecursionError: maximum recursion depth exceeded">def test_recursion_error():
# Infinite recursion triggers RecursionError
def recursive():
return recursive()
&gt; recursive()
tests/test_math_utils.py:75:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_math_utils.py:74: in recursive
return recursive()
tests/test_math_utils.py:74: in recursive
return recursive()
E RecursionError: maximum recursion depth exceeded
!!! Recursion detected (same locals &amp; position)</failure></testcase><testcase classname="tests.test_math_utils" name="test_floating_point_error" time="0.000"><failure message="FloatingPointError: Simulated floating point error">def test_floating_point_error():
# Manually raise FloatingPointError (rare in practice)
&gt; raise FloatingPointError("Simulated floating point error")
E FloatingPointError: Simulated floating point error
tests/test_math_utils.py:79: FloatingPointError</failure></testcase><testcase classname="tests.test_math_utils" name="test_floating_point_overflow" time="0.000"><failure message="OverflowError: math range error">def test_floating_point_overflow():
# Exponential overflow triggers OverflowError
&gt; math.exp(1000)
E OverflowError: math range error
tests/test_math_utils.py:83: OverflowError</failure></testcase><testcase classname="tests.test_math_utils" name="test_value_error" time="0.000"><failure message="ValueError: invalid literal for int() with base 10: 'invalid'">def test_value_error():
# ValueError on invalid integer conversion
&gt; int("invalid")
E ValueError: invalid literal for int() with base 10: 'invalid'
tests/test_math_utils.py:87: ValueError</failure></testcase><testcase classname="tests.test_math_utils" name="test_type_error" time="0.000"><failure message="TypeError: 'int' object is not iterable">def test_type_error():
# TypeError when passing wrong argument type to sum
&gt; sum(5)
E TypeError: 'int' object is not iterable
tests/test_math_utils.py:91: TypeError</failure></testcase><testcase classname="tests.test_math_utils" name="test_unhandled_exception" time="0.000"><failure message="Exception: Generic unhandled exception">def test_unhandled_exception():
# Raises generic unhandled Exception
&gt; raise Exception("Generic unhandled exception")
E Exception: Generic unhandled exception
tests/test_math_utils.py:95: Exception</failure></testcase><testcase classname="tests.test_math_utils" name="test_custom_error" time="0.000"><failure message="test_math_utils.CustomError: Custom error simulation">def test_custom_error():
# Raises user-defined CustomError exception
&gt; raise CustomError("Custom error simulation")
E test_math_utils.CustomError: Custom error simulation
tests/test_math_utils.py:99: CustomError</failure></testcase><testcase classname="tests.test_math_utils" name="test_stop_iteration_direct" time="0.000"><failure message="RuntimeError: generator raised StopIteration">def test_stop_iteration_direct():
# Directly raise StopIteration exception
&gt; raise StopIteration()
E StopIteration
tests/test_math_utils.py:103: StopIteration
The above exception was the direct cause of the following exception:
cls = &lt;class '_pytest.runner.CallInfo'&gt;
func = &lt;function call_and_report.&lt;locals&gt;.&lt;lambda&gt; at 0x7f6f74900550&gt;
when = 'call'
reraise = (&lt;class '_pytest.outcomes.Exit'&gt;, &lt;class 'KeyboardInterrupt'&gt;)
@classmethod
def from_call(
cls,
func: Callable[[], TResult],
when: Literal["collect", "setup", "call", "teardown"],
reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
) -&gt; CallInfo[TResult]:
"""Call func, wrapping the result in a CallInfo.
:param func:
The function to call. Called without arguments.
:type func: Callable[[], _pytest.runner.TResult]
:param when:
The phase in which the function is called.
:param reraise:
Exception or exceptions that shall propagate if raised by the
function, instead of being wrapped in the CallInfo.
"""
excinfo = None
start = timing.time()
precise_start = timing.perf_counter()
try:
&gt; result: TResult | None = func()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/site-packages/_pytest/runner.py:242: in &lt;lambda&gt;
lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_hooks.py:513: in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
.pixi/envs/default/lib/python3.8/site-packages/pluggy/_manager.py:120: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
yield from thread_exception_runtest_hook()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
yield
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
.pixi/envs/default/lib/python3.8/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
yield
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:846: in pytest_runtest_call
yield from self._runtest_for(item, "call")
.pixi/envs/default/lib/python3.8/site-packages/_pytest/logging.py:829: in _runtest_for
yield
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = &lt;CaptureManager _method='no' _global_capturing=&lt;MultiCapture out=None err=None in_=None _state='suspended' _in_suspended=False&gt; _capture_fixture=None&gt;
item = &lt;Function test_stop_iteration_direct&gt;
@hookimpl(wrapper=True)
def pytest_runtest_call(self, item: Item) -&gt; Generator[None]:
with self.item_capture("call", item):
&gt; return (yield)
E RuntimeError: generator raised StopIteration
.pixi/envs/default/lib/python3.8/site-packages/_pytest/capture.py:880: RuntimeError</failure></testcase><testcase classname="tests.test_math_utils" name="test_generator_exit_direct" time="0.000"><failure message="GeneratorExit">def test_generator_exit_direct():
# Directly raise GeneratorExit exception
&gt; raise GeneratorExit()
E GeneratorExit
tests/test_math_utils.py:107: GeneratorExit</failure></testcase><testcase classname="tests.test_math_utils" name="test_recursion_limit" time="0.000"><failure message="RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low">def test_recursion_limit():
# Lower recursion limit to force RecursionError on deep recursion
original_limit = sys.getrecursionlimit()
&gt; sys.setrecursionlimit(50)
E RecursionError: cannot set the recursion limit to 50 at the recursion depth 37: the limit is too low
tests/test_math_utils.py:112: RecursionError</failure></testcase><testcase classname="tests.test_math_utils" name="test_malformed_code" time="0.000"><failure message=" File &quot;&lt;string&gt;&quot;, line 1&#10; def bad(:&#10; ^&#10;SyntaxError: invalid syntax">def test_malformed_code():
# SyntaxError when executing malformed Python code
&gt; exec("def bad(:\n pass")
E File "&lt;string&gt;", line 1
E def bad(:
E ^
E SyntaxError: invalid syntax
tests/test_math_utils.py:122: SyntaxError</failure></testcase><testcase classname="tests.test_math_utils" name="test_sys_exit" time="0.000"><failure message="SystemExit: 1">def test_sys_exit():
# Simulate SystemExit via sys.exit
&gt; sys.exit(1)
E SystemExit: 1
tests/test_math_utils.py:126: SystemExit</failure></testcase><testcase classname="tests.test_math_utils" name="test_broken_function" time="0.000"><failure message="TypeError: Broken function">def test_broken_function():
# Simulate broken function raising TypeError
def broken_func(*args, **kwargs):
raise TypeError("Broken function")
&gt; broken_func()
tests/test_math_utils.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (), kwargs = {}
def broken_func(*args, **kwargs):
&gt; raise TypeError("Broken function")
E TypeError: Broken function
tests/test_math_utils.py:131: TypeError</failure></testcase><testcase classname="tests.test_math_utils" name="test_import_error_patch" time="0.000"><failure message="ImportError: Simulated ImportError">def test_import_error_patch():
# Patch import to simulate ImportError on specific module
original_import = __import__
def fake_import(name, *args, **kwargs):
if name == "fake_module":
raise ImportError("Simulated ImportError")
return original_import(name, *args, **kwargs)
import builtins
builtins.__import__, old_import = fake_import, builtins.__import__
try:
&gt; __import__("fake_module")
tests/test_math_utils.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'fake_module', args = (), kwargs = {}
def fake_import(name, *args, **kwargs):
if name == "fake_module":
&gt; raise ImportError("Simulated ImportError")
E ImportError: Simulated ImportError
tests/test_math_utils.py:139: ImportError</failure></testcase><testcase classname="tests.test_math_utils" name="test_module_not_found_error" time="0.001"><failure message="ModuleNotFoundError: No module named 'non_existent_module_xyz'">def test_module_not_found_error():
# Raises ModuleNotFoundError (subclass of ImportError) for missing module
&gt; importlib.import_module("non_existent_module_xyz")
tests/test_math_utils.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.pixi/envs/default/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'non_existent_module_xyz'
import_ = &lt;function _gcd_import at 0x7f6f793954c0&gt;
&gt; ???
E ModuleNotFoundError: No module named 'non_existent_module_xyz'
&lt;frozen importlib._bootstrap&gt;:973: ModuleNotFoundError</failure></testcase><testcase classname="tests.test_string_utils" name="test_uppercase_normal" time="0.000" /><testcase classname="tests.test_string_utils" name="test_uppercase_type_error" time="0.000"><failure message="TypeError: Input cannot be None">def test_uppercase_type_error():
# TypeError when input is None (invalid input)
&gt; uppercase(None)
tests/test_string_utils.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
s = None
def uppercase(s):
if s is None:
&gt; raise TypeError("Input cannot be None")
E TypeError: Input cannot be None
functions/string_utils.py:3: TypeError</failure></testcase><testcase classname="tests.test_string_utils" name="test_reverse_string" time="0.000" /><testcase classname="tests.test_string_utils" name="test_warning_emit" time="0.000" /><testcase classname="tests.test_string_utils" name="test_unicode_decode_error" time="0.000"><failure message="UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte">def test_unicode_decode_error():
# UnicodeDecodeError when decoding invalid byte sequence
&gt; b'\xff'.decode('utf-8')
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
tests/test_string_utils.py:26: UnicodeDecodeError</failure></testcase><testcase classname="tests.test_string_utils" name="test_unicode_decode_surrogateescape" time="0.000"><failure message="UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte">def test_unicode_decode_surrogateescape():
# UnicodeDecodeError with strict error handler on invalid byte
&gt; b"\x80".decode("utf-8", errors="strict")
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
tests/test_string_utils.py:30: UnicodeDecodeError</failure></testcase><testcase classname="tests.test_string_utils" name="test_import_warning" time="0.000" /><testcase classname="tests.test_string_utils" name="test_xfail_uppercase_digits" time="0.000"><skipped type="pytest.xfail" message="Expected failure: uppercase does not handle digits" /></testcase><testcase time="0.000" /></testsuite></testsuites>