| ============================= test session starts ==============================
|
| platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /app/pastebin_plugin/venv/bin/python
|
| rootdir: /app/pastebin_plugin
|
| collected 5 items
|
|
|
| test_pastebin.py ....F [100%]
|
|
|
| =================================== FAILURES ===================================
|
| ___________________________ test_failed_mode_content ___________________________
|
|
|
| def test_failed_mode_content():
|
| plugin = PastebinPlugin("failed")
|
| # Mock reports with failed test in module
|
| plugin.reports = [type("Report", (), {
|
| "outcome": "failed",
|
| "fspath": type("Fspath", (), {"str": lambda: "test_module.py"})(),
|
| "nodeid": "test_module.py::test_fail"
|
| })()]
|
| > content = plugin._generate_failed_content()
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
| test_pastebin.py:33:
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
| self = <pastebin.PastebinPlugin object at 0x783a8c8a1190>
|
|
|
| def _generate_failed_content(self):
|
| failed_modules = set()
|
| for report in self.reports:
|
| if report.outcome == "failed":
|
| failed_modules.add(report.fspath)
|
| if not failed_modules:
|
| return None
|
| content = b""
|
| for module in failed_modules:
|
| > with open(str(module), "rb") as f:
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
| E FileNotFoundError: [Errno 2] No such file or directory: '<pastebin_plugin.test_pastebin.Fspath object at 0x783a8c8a3020>'
|
|
|
| pastebin.py:63: FileNotFoundError
|
| =========================== short test summary info ============================
|
| FAILED test_pastebin.py::test_failed_mode_content - FileNotFoundError: [Errno...
|
| =================== 1 failed, 4 passed in 159.55s (0:02:39) ====================
|