Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test helpers: Remove unneeded data generation abstractions #5463

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

snejus
Copy link
Member

@snejus snejus commented Oct 16, 2024

This PR refactors the test codebase by removing redundant functions and simplifying item
and album creation. Key changes include:

  • Removed redundant _item_ident index tracker from _common.py.
  • Removed album function from _common.py replacing it with direct library.Album invocations.
  • Removed generate_album_info and generate_track_info functions, replacing them directly with TrackInfo and AlbumInfo.
  • Updated setup.cfg to exclude test helper files from coverage reports.
  • Adjusted the tests regarding the changes, and simplified test_mbsync.py.

These functions were used to generate mock data for tests but have been
replaced with direct instantiation of AlbumInfo and TrackInfo objects.
This change simplifies the test code and removes unnecessary helper
functions.
Fun fact: it was the coverage data that revealed that this logic is not
used.
@snejus snejus self-assigned this Oct 16, 2024
@snejus snejus requested a review from bal-e October 16, 2024 12:16
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copy link
Member

@bal-e bal-e left a comment

Choose a reason for hiding this comment

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

I'm glad to see some of these helpers getting cleaned out :)

@snejus snejus merged commit de171f0 into master Nov 13, 2024
16 checks passed
@snejus snejus deleted the tests/remove-generate-info branch November 13, 2024 14:16
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