-
Notifications
You must be signed in to change notification settings - Fork 86
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
PLAT-138 Follow Up to #1114 #1116
Conversation
tests/schema.py
Outdated
|
||
|
||
LOCALS_ANY = {k: v for k, v in locals().items() if inspect.isclass(v)} | ||
__all__ = list(LOCALS_ANY.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__all__ = list(LOCALS_ANY.keys()) | |
__all__ = list(LOCALS_ANY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. I'll make these fixes in another WIP PR to datajoint:dev-tests
branch.
tests/schema_advanced.py
Outdated
@@ -135,3 +133,6 @@ class GlobalSynapse(dj.Manual): | |||
-> Cell.proj(pre_slice="slice", pre_cell="cell") | |||
-> Cell.proj(post_slice="slice", post_cell="cell") | |||
""" | |||
|
|||
LOCALS_ADVANCED = {k: v for k, v in locals().items() if inspect.isclass(v)} | |||
__all__ = list(LOCALS_ADVANCED.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__all__ = list(LOCALS_ADVANCED.keys()) | |
__all__ = list(LOCALS_ADVANCED) |
tests/schema_simple.py
Outdated
|
||
|
||
LOCALS_SIMPLE = {k: v for k, v in locals().items() if inspect.isclass(v)} | ||
__all__ = list(LOCALS_SIMPLE.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__all__ = list(LOCALS_SIMPLE.keys()) | |
__all__ = list(LOCALS_SIMPLE) |
tests/test_adapted_attributes.py::test_adapted_filepath_type throws datajoint/s3.py:54: BucketInaccessible
tests/test_adapted_attributes.py
Outdated
@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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to set up schema_adapted
in conftest.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The adapted schema schema_ad
is only used in this module, so I kept it as a module-specific fixture.
CI is failing |
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.