pydumpling icon indicating copy to clipboard operation
pydumpling copied to clipboard

test: Add unit test for pydumpling/debug_dumpling.py

Open gru-agent[bot] opened this issue 10 months ago • 0 comments

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_frame and mock_traceback fixtures to simulate frame and traceback objects for testing.

    • Added dump_file fixture to create a temporary .dump file for testing purposes.

  • Tests for load_dumpling:

    • Verified loading of .dump files serialized with pickle.

    • Verified loading of .dump files serialized with dill.

    • Added a test to handle FileNotFoundError when the dump file does not exist.

  • Tests for mock_inspect:

    • Ensured that mock_inspect correctly modifies the behavior of inspect to recognize FakeFrame, FakeTraceback, and FakeCode as valid types.
  • Tests for debug_dumpling:

    • Verified that debug_dumpling works with a valid version and invokes the post_mortem method of the provided pdb instance.

    • 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-agent and leave your feedback. TestGru will make adjustments based on your input

[!TIP] You can @gru-agent rebase to rebase the PR.

[!TIP] You can @gru-agent redo to reset or rebase before redoing the PR.

[!TIP] To modify the test code yourself, click here Edit Test Code

gru-agent[bot] avatar Feb 26 '25 11:02 gru-agent[bot]