Skip to content

Conversation

@paulz
Copy link
Contributor

@paulz paulz commented Apr 4, 2025

This pull request introduces several changes to improve testing, documentation, and dependency management in the codebase. The main changes include the addition of new fixtures for pytest, updates to the CLAUDE.md file, and enhancements to the Reporter class tests.

Documentation and Dependency Management:

  • CLAUDE.md: Added a new file with guidance for using Claude Code, including commands for installing dependencies, running tests, type checking, linting, and formatting, as well as code style guidelines.
  • pyproject.toml: Added ipykernel and ipython to the development dependencies.

Testing Enhancements:

  • tests/conftest.py: Introduced new pytest fixtures for creating Reporter instances, analyzing failure rates, exporting results to CSV, and configuring matplotlib for consistent snapshot testing.
  • tests/test_reporter.py: Updated tests to utilize the new reporter_factory fixture and improved the test_report_creates_correct_json test to verify metadata and output paths.
  • tests/test_runner.py: Refactored tests to use the tmp_reporter fixture and added parameterized tests for running with environment variables. [1] [2] [3]

Snapshot Testing and Statistical Analysis:

paulz added 6 commits April 3, 2025 18:36
Add CLAUDE.md for project guidelines

Signed-off-by: Paul Zabelin <[email protected]>
crashes on any command

chore: add ipykernel and ipython to dev dependencies
Signed-off-by: Paul Zabelin <[email protected]>
but reading actual report files

Signed-off-by: Paul Zabelin <[email protected]>
@paulz paulz requested a review from Copilot April 4, 2025 03:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • tests/snapshots/test_reporter/test_report_creates_correct_json/expected_report.json: Language not supported
Comments suppressed due to low confidence (1)

tests/test_runner.py:7

  • [nitpick] Consider using a more specific type annotation for the 'reporter' parameter in dummy_test_function to clarify the expected interface, instead of using the generic 'object'.
def dummy_test_function(reporter: object) -> bool:

@paulz paulz requested a review from Copilot April 4, 2025 03:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • tests/snapshots/test_reporter/test_report_creates_correct_json/expected_report.json: Language not supported
Comments suppressed due to low confidence (2)

tests/test_statistical_analysis.py:122

  • [nitpick] The variable name 'csv' shadows the csv module and may lead to confusion. Consider renaming it to something like 'csv_output'.
csv = export_results_to_csv(results)

tests/test_statistical_analysis.py:159

  • After saving the figure for snapshot comparison, there is no call to plt.close(), which might lead to resource warnings. Consider adding plt.close() to ensure proper cleanup.
snapshot.assert_match(buf.read(), "failure_rate_bar_graph.png")

@paulz paulz requested a review from Copilot April 4, 2025 03:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • tests/snapshots/test_reporter/test_report_creates_correct_json/expected_report.json: Language not supported
Comments suppressed due to low confidence (2)

tests/test_runner.py:19

  • [nitpick] Consider renaming the lambda parameter from 'x' to '_' to indicate that it is unused, ensuring consistency with other tests.
runner = Runner(test_function=lambda x: return_value, reporter=tmp_reporter)

tests/test_reporter.py:31

  • [nitpick] Consider using the reporter_factory fixture for creating Reporter instances instead of manually setting parameters to maintain consistency across tests.
def test_report_creates_correct_json(test_name: str, snapshot: Any) -> None:

@kseebaldt kseebaldt merged commit de86ec7 into thisisartium:main Apr 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants