You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is likely a bit of an edge case, but because we import pytest at the top of yt.testing, one needs pytest installed to import yt.testing.
I commonly use the fake_ datasets in various ways, often in fresh environments and I know of at least one place in the docs where we explicitly import yt.testing (https://yt-project.org/doc/examining/loading_via_functions.html), both of which result in import errors if you only do a pip install yt or even a pip install yt[full].
Any objection to me fixing that?
I the minimal fix is to just move that import pytest to within the only function that uses it (requires_module_pytest). alternatively, I think yt.testing has grown to the point where it might make sense to split it up a bit -- maybe move all of the fake_ dataset constructors to their own module in order to separate dataset construction from test execution utilities?
The text was updated successfully, but these errors were encountered:
I also ran into this! I think moving the fake stuff somewhere else would be fine, or even hiding it inside something like load_sample() somehow, I dunno.
For context #3771
No objection to nesting the imports. Splitting the module may not be worth the backward compatibility layer needed to not break downstream users.
Ok, splitting out the fake_ datasets did indeed prove rather annoying... I may think more about that in the future, but for now I just submitted a PR that simply nests the pytest import.
This is likely a bit of an edge case, but because we
import pytest
at the top ofyt.testing
, one needspytest
installed to importyt.testing
.I commonly use the
fake_
datasets in various ways, often in fresh environments and I know of at least one place in the docs where we explicitly importyt.testing
(https://yt-project.org/doc/examining/loading_via_functions.html), both of which result in import errors if you only do apip install yt
or even apip install yt[full]
.Any objection to me fixing that?
I the minimal fix is to just move that
import pytest
to within the only function that uses it (requires_module_pytest
). alternatively, I thinkyt.testing
has grown to the point where it might make sense to split it up a bit -- maybe move all of thefake_
dataset constructors to their own module in order to separate dataset construction from test execution utilities?The text was updated successfully, but these errors were encountered: