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

TST Refactor test fixture to be more atomic #175

Merged
merged 8 commits into from
Oct 7, 2022

Conversation

E-Aho
Copy link
Collaborator

@E-Aho E-Aho commented Oct 5, 2022

Small PR to split the responsibilities of the model_card_metadata_from_config fixture to be more atomic, with fixtures that

  1. Fetch the Iris data
  2. Creates an estimator from the Iris data
  3. Pickles estimator in a temp file
  4. Create a model card based on other fixtures

Notes:

  • Could also now refactor the other places where the iris data is called to use the fixture, or could remove the Iris fetch fetch fixture all together and just call load_iris in each fixture.

Should resolve #166

@E-Aho E-Aho changed the title Refactor model card from metadata to be more atomic Refactor test fixture to be more atomic Oct 5, 2022
Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

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

This looks very neat & clean, thank you ❤️🙂
This is not obligatory but can you check if anything else could be refactored in the main tests, given that we have new fixtures?

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Looks very good, thanks. @merveenoyan can you confirm that this simplifies the code for your initial concern?

@E-Aho
Copy link
Collaborator Author

E-Aho commented Oct 6, 2022

This looks very neat & clean, thank you ❤️🙂 This is not obligatory but can you check if anything else could be refactored in the main tests, given that we have new fixtures?

Thanks ❤️ 😄

I can definitely do that, I'll add another commit to this later today to refactor places that can now use these fixtures

@E-Aho
Copy link
Collaborator Author

E-Aho commented Oct 6, 2022

Updated the skops test that I think @merveenoyan was talking about in the original issue, all now use the fixtures so there's minimal set up in the tests themselves :)

@merveenoyan
Copy link
Collaborator

@BenjaminBossan yes it does!

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

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

Overall looks very good to me! @BenjaminBossan can you merge if you approve too?

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

skops/card/tests/test_card.py Outdated Show resolved Hide resolved
skops/card/tests/test_card.py Outdated Show resolved Hide resolved
@adrinjalali adrinjalali changed the title Refactor test fixture to be more atomic TST Refactor test fixture to be more atomic Oct 7, 2022
@adrinjalali adrinjalali merged commit b069c5f into skops-dev:main Oct 7, 2022
@E-Aho E-Aho deleted the Refactor-fixture-to-be-atomic branch October 7, 2022 12:37
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.

Make pytest fixtures atomic
4 participants