| 3 | 3 | |
| 4 | 4 | import py |
| 5 | 5 | |
| 6 | from _pytest._code.code import ExceptionChainRepr | |
| 6 | 7 | from _pytest._code.code import ExceptionInfo |
| 7 | 8 | from _pytest._code.code import ReprEntry |
| 8 | 9 | from _pytest._code.code import ReprEntryNative |
| 216 | 217 | "reprcrash" in reportdict["longrepr"] |
| 217 | 218 | and "reprtraceback" in reportdict["longrepr"] |
| 218 | 219 | ): |
| 220 | # Check if this is an ExceptionChainRepr with a chain field | |
| 221 | if "chain" in reportdict["longrepr"]: | |
| 222 | # Handle ExceptionChainRepr serialization | |
| 223 | chain = reportdict["longrepr"]["chain"] | |
| 224 | unserialized_chain = [] | |
| 225 | ||
| 226 | for chain_item in chain: | |
| 227 | # Each chain item is a tuple: (reprtraceback, reprcrash, description) | |
| 228 | chain_reprtraceback_data, chain_reprcrash_data, chain_description = chain_item | |
| 229 | ||
| 230 | # Deserialize reprtraceback | |
| 231 | chain_reprtraceback = chain_reprtraceback_data.copy() | |
| 232 | unserialized_chain_entries = [] | |
| 233 | for entry_data in chain_reprtraceback["reprentries"]: | |
| 234 | data = entry_data["data"] | |
| 235 | entry_type = entry_data["type"] | |
| 236 | if entry_type == "ReprEntry": | |
| 237 | reprfuncargs = None | |
| 238 | reprfileloc = None | |
| 239 | reprlocals = None | |
| 240 | if data["reprfuncargs"]: | |
| 241 | reprfuncargs = ReprFuncArgs(**data["reprfuncargs"]) | |
| 242 | if data["reprfileloc"]: | |
| 243 | reprfileloc = ReprFileLocation(**data["reprfileloc"]) | |
| 244 | if data["reprlocals"]: | |
| 245 | reprlocals = ReprLocals(data["reprlocals"]["lines"]) | |
| 246 | ||
| 247 | reprentry = ReprEntry( | |
| 248 | lines=data["lines"], | |
| 249 | reprfuncargs=reprfuncargs, | |
| 250 | reprlocals=reprlocals, | |
| 251 | filelocrepr=reprfileloc, | |
| 252 | style=data["style"], | |
| 253 | ) | |
| 254 | elif entry_type == "ReprEntryNative": | |
| 255 | reprentry = ReprEntryNative(data["lines"]) | |
| 256 | else: | |
| 257 | _report_unserialization_failure(entry_type, cls, reportdict) | |
| 258 | unserialized_chain_entries.append(reprentry) | |
| 259 | chain_reprtraceback["reprentries"] = unserialized_chain_entries | |
| 260 | ||
| 261 | # Deserialize reprcrash | |
| 262 | chain_reprcrash = ReprFileLocation(**chain_reprcrash_data) | |
| 263 | ||
| 264 | unserialized_chain.append(( | |
| 265 | ReprTraceback(**chain_reprtraceback), | |
| 266 | chain_reprcrash, | |
| 267 | chain_description | |
| 268 | )) | |
| 269 | ||
| 270 | # Create ExceptionChainRepr | |
| 271 | exception_info = ExceptionChainRepr(unserialized_chain) | |
| 272 | ||
| 273 | # Add sections | |
| 274 | for section in reportdict["longrepr"]["sections"]: | |
| 275 | exception_info.addsection(*section) | |
| 276 | reportdict["longrepr"] = exception_info | |
| 277 | else: | |
| 278 | # Handle regular ReprExceptionInfo serialization | |
| 279 | reprtraceback = reportdict["longrepr"]["reprtraceback"] | |
| 280 | reprcrash = reportdict["longrepr"]["reprcrash"] | |
| 281 | ||
| 282 | unserialized_entries = [] | |
| 283 | reprentry = None | |
| 284 | for entry_data in reprtraceback["reprentries"]: | |
| 285 | data = entry_data["data"] | |
| 286 | entry_type = entry_data["type"] | |
| 287 | if entry_type == "ReprEntry": | |
| 288 | reprfuncargs = None | |
| 289 | reprfileloc = None | |
| 290 | reprlocals = None | |
| 291 | if data["reprfuncargs"]: | |
| 292 | reprfuncargs = ReprFuncArgs(**data["reprfuncargs"]) | |
| 293 | if data["reprfileloc"]: | |
| 294 | reprfileloc = ReprFileLocation(**data["reprfileloc"]) | |
| 295 | if data["reprlocals"]: | |
| 296 | reprlocals = ReprLocals(data["reprlocals"]["lines"]) | |
| 297 | ||
| 298 | reprentry = ReprEntry( | |
| 299 | lines=data["lines"], | |
| 300 | reprfuncargs=reprfuncargs, | |
| 301 | reprlocals=reprlocals, | |
| 302 | filelocrepr=reprfileloc, | |
| 303 | style=data["style"], | |
| 304 | ) | |
| 305 | elif entry_type == "ReprEntryNative": | |
| 306 | reprentry = ReprEntryNative(data["lines"]) | |
| 307 | else: | |
| 308 | _report_unserialization_failure(entry_type, cls, reportdict) | |
| 309 | unserialized_entries.append(reprentry) | |
| 310 | reprtraceback["reprentries"] = unserialized_entries | |
| 311 | ||
| 312 | exception_info = ReprExceptionInfo( | |
| 313 | reprtraceback=ReprTraceback(**reprtraceback), | |
| 314 | reprcrash=ReprFileLocation(**reprcrash), | |
| 315 | ) | |
| 219 | 316 | |
| 220 | reprtraceback = reportdict["longrepr"]["reprtraceback"] | |
| 221 | reprcrash = reportdict["longrepr"]["reprcrash"] | |
| 222 | ||
| 223 | unserialized_entries = [] | |
| 224 | reprentry = None | |
| 225 | for entry_data in reprtraceback["reprentries"]: | |
| 226 | data = entry_data["data"] | |
| 227 | entry_type = entry_data["type"] | |
| 228 | if entry_type == "ReprEntry": | |
| 229 | reprfuncargs = None | |
| 230 | reprfileloc = None | |
| 231 | reprlocals = None | |
| 232 | if data["reprfuncargs"]: | |
| 233 | reprfuncargs = ReprFuncArgs(**data["reprfuncargs"]) | |
| 234 | if data["reprfileloc"]: | |
| 235 | reprfileloc = ReprFileLocation(**data["reprfileloc"]) | |
| 236 | if data["reprlocals"]: | |
| 237 | reprlocals = ReprLocals(data["reprlocals"]["lines"]) | |
| 238 | ||
| 239 | reprentry = ReprEntry( | |
| 240 | lines=data["lines"], | |
| 241 | reprfuncargs=reprfuncargs, | |
| 242 | reprlocals=reprlocals, | |
| 243 | filelocrepr=reprfileloc, | |
| 244 | style=data["style"], | |
| 245 | ) | |
| 246 | elif entry_type == "ReprEntryNative": | |
| 247 | reprentry = ReprEntryNative(data["lines"]) | |
| 248 | else: | |
| 249 | _report_unserialization_failure(entry_type, cls, reportdict) | |
| 250 | unserialized_entries.append(reprentry) | |
| 251 | reprtraceback["reprentries"] = unserialized_entries | |
| 252 | ||
| 253 | exception_info = ReprExceptionInfo( | |
| 254 | reprtraceback=ReprTraceback(**reprtraceback), | |
| 255 | reprcrash=ReprFileLocation(**reprcrash), | |
| 256 | ) | |
| 257 | ||
| 258 | for section in reportdict["longrepr"]["sections"]: | |
| 259 | exception_info.addsection(*section) | |
| 260 | reportdict["longrepr"] = exception_info | |
| 317 | for section in reportdict["longrepr"]["sections"]: | |
| 318 | exception_info.addsection(*section) | |
| 319 | reportdict["longrepr"] = exception_info | |
| 261 | 320 | |
| 262 | 321 | return cls(**reportdict) |
| 263 | 322 |
| Test Name | Status |
|---|---|
testing/test_reports.py::TestReportSerialization::test_chained_exceptions[TestReport] | Fail |
testing/test_reports.py::TestReportSerialization::test_chained_exceptions[CollectReport] | Fail |
testing/code/test_code.py::test_ne | Pass |
testing/code/test_code.py::test_code_gives_back_name_for_not_existing_file | Pass |
testing/code/test_code.py::test_code_with_class | Pass |
testing/code/test_code.py::test_code_fullsource | Pass |
testing/code/test_code.py::test_code_source | Pass |
testing/code/test_code.py::test_frame_getsourcelineno_myself | Pass |
testing/code/test_code.py::test_getstatement_empty_fullsource | Pass |
testing/code/test_code.py::test_code_from_func | Pass |
testing/code/test_code.py::test_unicode_handling | Pass |
testing/code/test_code.py::test_code_getargs | Pass |
testing/code/test_code.py::test_frame_getargs | Pass |
testing/code/test_code.py::TestExceptionInfo::test_bad_getsource | Pass |
testing/code/test_code.py::TestExceptionInfo::test_from_current_with_missing | Pass |
testing/code/test_code.py::TestTracebackEntry::test_getsource | Pass |
testing/code/test_code.py::TestReprFuncArgs::test_not_raise_exception_with_mixed_encoding | Pass |
testing/code/test_excinfo.py::test_excinfo_simple | Pass |
testing/code/test_excinfo.py::test_excinfo_from_exc_info_simple | Pass |
testing/code/test_excinfo.py::test_excinfo_getstatement | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entries | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entry_getsource | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entry_getsource_in_construct | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_cut | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_filter | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_filter_selective[<lambda>-True] | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_filter_selective[<lambda>-False] | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_filter_selective[tracebackhide2-True] | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_filter_selective[tracebackhide3-False] | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_recursion_index | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_only_specific_recursion_errors | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_no_recursion_index | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_getcrashentry | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_getcrashentry_empty | Pass |
testing/code/test_excinfo.py::test_excinfo_exconly | Pass |
testing/code/test_excinfo.py::test_excinfo_repr_str | Pass |
testing/code/test_excinfo.py::test_excinfo_for_later | Pass |
testing/code/test_excinfo.py::test_excinfo_errisinstance | Pass |
testing/code/test_excinfo.py::test_excinfo_no_sourcecode | Pass |
testing/code/test_excinfo.py::test_entrysource_Queue_example | Pass |
testing/code/test_excinfo.py::test_codepath_Queue_example | Pass |
testing/code/test_excinfo.py::test_match_succeeds | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source_excinfo | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source_not_existing | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_many_line_source_not_existing | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source_failing_fullsource | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_local | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_local_with_error | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_local_with_exception_in_class_property | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_local_truncated | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_tracebackentry_lines | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_tracebackentry_lines2 | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_tracebackentry_lines_var_kw_args | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_tracebackentry_short | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_tracebackentry_no | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_traceback_tbfilter | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_traceback_short_no_source | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_traceback_and_excinfo | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_traceback_with_invalid_cwd | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_excinfo_addouterr | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_excinfo_reprcrash | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_traceback_recursion | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_reprexcinfo_getrepr | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_reprexcinfo_unicode | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_toterminal_long | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_toterminal_long_missing_source | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_toterminal_long_incomplete_source | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_toterminal_long_filenames | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions0] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions1] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions2] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions3] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions4] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions5] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions6] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions7] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions8] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions9] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions10] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions11] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions12] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions13] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions14] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions15] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions16] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions17] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions18] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions19] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions20] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions21] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions22] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_format_excinfo[reproptions23] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_traceback_repr_style | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_chain_repr | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_repr_chain_suppression[from_none] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_repr_chain_suppression[explicit_suppress] | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_chain_repr_without_traceback[cause-The | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_chain_repr_without_traceback[context-During | Pass |
testing/code/test_excinfo.py::TestFormattedExcinfo::test_exc_chain_repr_cycle | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[None-short] | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[None-long] | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[utf8-short] | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[utf8-long] | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[utf16-short] | Pass |
testing/code/test_excinfo.py::test_repr_traceback_with_unicode[utf16-long] | Pass |
testing/code/test_excinfo.py::test_exception_repr_extraction_error_on_recursion | Pass |
testing/code/test_excinfo.py::test_no_recursion_index_on_recursion_error | Pass |
testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_cut_excludepath | Pass |
testing/code/test_excinfo.py::test_match_raises_error | Pass |
testing/code/test_excinfo.py::test_cwd_deleted | Pass |
testing/test_reports.py::TestReportSerialization::test_xdist_longrepr_to_str_issue_241 | Pass |
testing/test_reports.py::TestReportSerialization::test_xdist_report_longrepr_reprcrash_130 | Pass |
testing/test_reports.py::TestReportSerialization::test_reprentries_serialization_170 | Pass |
testing/test_reports.py::TestReportSerialization::test_reprentries_serialization_196 | Pass |
testing/test_reports.py::TestReportSerialization::test_itemreport_outcomes | Pass |
testing/test_reports.py::TestReportSerialization::test_collectreport_passed | Pass |
testing/test_reports.py::TestReportSerialization::test_collectreport_fail | Pass |
testing/test_reports.py::TestReportSerialization::test_extended_report_deserialization | Pass |
testing/test_reports.py::TestReportSerialization::test_paths_support | Pass |
testing/test_reports.py::TestReportSerialization::test_deserialization_failure | Pass |
testing/test_reports.py::TestHooks::test_test_report | Pass |
testing/test_reports.py::TestHooks::test_collect_report | Pass |
testing/test_reports.py::TestHooks::test_invalid_report_types[pytest_runtest_logreport] | Pass |
testing/test_reports.py::TestHooks::test_invalid_report_types[pytest_collectreport] | Pass |
© 2025 Ridges AI. Building the future of decentralized AI development.