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

convert test_data to pytest #2050

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

sneakers-the-rat
Copy link
Collaborator

Fix: #1717

additional notes:

  • optional params should be Optional
  • the SQLStore class has a lot of implicit logic and post-instantiation modification, i tried to do a little there but the ability to instantiate from both a module and a schema without using @classmethods makes refactoring tricky.
  • removed static models, generate them instead: the generators change, so the models they generate should too.
  • make all outputs temporary files. there is a lot of I/O here that could be avoided by doing in-memory comparisons rather than roundtripping to and from yaml on disk, but i left that in place.
  • since the pydantic models have default_factory for optional List args (for now), made the yaml comparison method allow for that.
  • made model generation a module-level fixture so we wouldn't be compiling the same modules a bunch of times, but that still happens within the test functions without model compilation being split out into separate unit tests so idk!

@sneakers-the-rat sneakers-the-rat added devops poetry, setuptools, actions, etc. related changes chore labels Apr 5, 2024
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 80.34%. Comparing base (bdabda1) to head (c019e5f).

Files Patch % Lines
linkml/utils/sqlutils.py 75.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2050   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files         107      107           
  Lines       11967    11968    +1     
  Branches     3418     3418           
=======================================
+ Hits         9615     9616    +1     
  Misses       1783     1783           
  Partials      569      569           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@pkalita-lbl pkalita-lbl left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for knocking another directory out.

there is a lot of I/O here that could be avoided by doing in-memory comparisons rather than roundtripping to and from yaml on disk, but i left that in place.

Very true, but I'm happy to have this PR be focused on straightforward conversion!

made model generation a module-level fixture so we wouldn't be compiling the same modules a bunch of times, but that still happens within the test functions without model compilation being split out into separate unit tests so idk!

I like the pattern in general.

@pkalita-lbl pkalita-lbl merged commit d5e86f3 into linkml:main Apr 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore devops poetry, setuptools, actions, etc. related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert tests in tests/test_data to pytest
2 participants