PLAT-138 Follow Up to #1114#1116
Merged
A-Baji merged 16 commits intodatajoint:dev-testsfrom Dec 5, 2023
Merged
Conversation
|
|
||
|
|
||
| LOCALS_ANY = {k: v for k, v in locals().items() if inspect.isclass(v)} | ||
| __all__ = list(LOCALS_ANY.keys()) |
Member
There was a problem hiding this comment.
Suggested change
| __all__ = list(LOCALS_ANY.keys()) | |
| __all__ = list(LOCALS_ANY) |
Contributor
Author
There was a problem hiding this comment.
Thanks for the review. I'll make these fixes in another WIP PR to datajoint:dev-tests branch.
| """ | ||
|
|
||
| LOCALS_ADVANCED = {k: v for k, v in locals().items() if inspect.isclass(v)} | ||
| __all__ = list(LOCALS_ADVANCED.keys()) |
Member
There was a problem hiding this comment.
Suggested change
| __all__ = list(LOCALS_ADVANCED.keys()) | |
| __all__ = list(LOCALS_ADVANCED) |
|
|
||
|
|
||
| LOCALS_SIMPLE = {k: v for k, v in locals().items() if inspect.isclass(v)} | ||
| __all__ = list(LOCALS_SIMPLE.keys()) |
Member
There was a problem hiding this comment.
Suggested change
| __all__ = list(LOCALS_SIMPLE.keys()) | |
| __all__ = list(LOCALS_SIMPLE) |
tests/test_adapted_attributes.py::test_adapted_filepath_type throws datajoint/s3.py:54: BucketInaccessible
This was referenced Dec 5, 2023
A-Baji
reviewed
Dec 5, 2023
Comment on lines
+38
to
+60
| @pytest.fixture | ||
| def schema_ad( | ||
| schema_name_custom_datatype, connection_test, adapted_graph_instance, | ||
| enable_adapted_types, enable_filepath_feature | ||
| ): | ||
| stores_config = { | ||
| "repo-s3": dict( | ||
| S3_CONN_INFO, protocol="s3", location="adapted/repo", stage=tempfile.mkdtemp() | ||
| ) | ||
| } | ||
| dj.config["stores"] = stores_config | ||
| layout_to_filepath = schema_adapted.LayoutToFilepath() | ||
| context = { | ||
| **schema_adapted.LOCALS_ADAPTED, | ||
| 'graph': adapted_graph_instance, | ||
| 'layout_to_filepath': layout_to_filepath, | ||
| } | ||
| schema = dj.schema(schema_name_custom_datatype, context=context, connection=connection_test) | ||
| graph = adapted_graph_instance | ||
| schema(schema_adapted.Connectivity) | ||
| schema(schema_adapted.Layout) | ||
| yield schema | ||
| schema.drop() |
Collaborator
There was a problem hiding this comment.
Any reason not to set up schema_adapted in conftest.py?
Contributor
Author
There was a problem hiding this comment.
The adapted schema schema_ad is only used in this module, so I kept it as a module-specific fixture.
Contributor
Author
|
CI is failing |
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.
I made some edits to the tests that were recently migrated to pytest in #1114. Minor edits so that we're closer to pytest standard practice. This includes decreasing the scope of the fixtures that return schemas.
This includes the changes from #1115 so please merge that one before this one.