test: Add unit test for pydumpling/debug_dumpling.py
Trigger Info
| Trigger Type | Triggered By | Source File | Assignment |
|---|---|---|---|
| Manual | cocolato | pydumpling/debug_dumpling.py | Detail |
Summary
This PR introduces a comprehensive test suite for the pydumpling library, specifically targeting the load_dumpling, mock_inspect, and debug_dumpling functionalities. The following changes are included:
-
Fixtures:
-
Added
mock_frameandmock_tracebackfixtures to simulate frame and traceback objects for testing. -
Added
dump_filefixture to create a temporary.dumpfile for testing purposes.
-
-
Tests for
load_dumpling:-
Verified loading of
.dumpfiles serialized withpickle. -
Verified loading of
.dumpfiles serialized withdill. -
Added a test to handle
FileNotFoundErrorwhen the dump file does not exist.
-
-
Tests for
mock_inspect:- Ensured that
mock_inspectcorrectly modifies the behavior ofinspectto recognizeFakeFrame,FakeTraceback, andFakeCodeas valid types.
- Ensured that
-
Tests for
debug_dumpling:-
Verified that
debug_dumplingworks with a valid version and invokes thepost_mortemmethod of the providedpdbinstance. -
Added tests to handle unsupported dumpling versions, including both very old and newer versions.
-
This test suite ensures robust validation of the core functionalities and improves the reliability of the pydumpling library.
[!TIP] You can
@gru-agentand leave your feedback. TestGru will make adjustments based on your input
[!TIP] You can
@gru-agent rebaseto rebase the PR.
[!TIP] You can
@gru-agent redoto reset or rebase before redoing the PR.
[!TIP] To modify the test code yourself, click here Edit Test Code