Fix tests-develop test - #510
Closed
mdondrup wants to merge 1 commit into
Closed
Conversation
We imported the fairmd.lipids package, whose __init__.py raises RuntimeError when FMDL_DATA_PATH points to a non-existent folder. Develop tests shouldn't trigger that heavy package initialization, so loading the schema from the filesystem keeps them isolated. Now loading the schema directly. If you think, loading the package initialization is necessary, you need to provide it with the proper environment in the test. (Btw, did I mention that unconditional loading of data from an environment variblble was a bad idea?))
Collaborator
Author
|
Member
|
I will not approve it. If we use something from the package, we must import it from the package. The error should be fixed in the manifests. |
Collaborator
Author
Ok just fix it the way you want. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes regression #508 introduced in #506 by loading fairmd.lipids module during a test stage which the test wasn't designed for.
When imported the fairmd.lipids package does some heavy lifting, whose init.py raises RuntimeError when FMDL_DATA_PATH points to a non-existent folder. Develop tests shouldn't trigger that heavy package initialization, so loading the schema from the filesystem keeps them isolated.
Now loading the schema directly again. If you think, loading the package initialization is necessary, you need to provide it with the proper environment in the test.
(Btw, did I mention that unconditional loading of data from an environment variable was a bad idea? init should be lazy loading and side-effect free )
📚 Documentation preview 📚: https://databank--510.org.readthedocs.build/