Cannot import xarray.tests due to use of pytest.config
See original GitHub issuexarray.tests cannot be imported due to the use of pytest.config:
$ python -c "import xarray; print(xarray.__version__); import xarray.tests"
0.9.2-3-g9479038
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/jhelmus/devel/xarray/xarray/tests/__init__.py", line 118, in <module>
not pytest.config.getoption("--run-flaky"),
AttributeError: module 'pytest' has no attribute 'config'
The use of pytest.config in the xarray/tests/__init__.py seem to have been introduced in #1336. From the discussion in pytest-dev/pytest#1688 it seems as if the use of pytest.config is discouraged.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
pytest cannot import module while python can - Stack Overflow
I'm using this from VS Code, in the test explorer under Windows in a conda environment, Python 3.8. The setup I have got...
Read more >What's New - Xarray
This release brings a number of bug fixes and improvements, most notably a major internal refactor of the indexing functionality, the use of...
Read more >Full pytest documentation
Install pytest · Create your first test · Run multiple tests · Assert that a certain exception is raised · Group multiple tests...
Read more >Scientific Computing | SciVision
import xarray import xarray.tests ; # run your simulation etc. dat = myfunc(...) ; # load the reference Dataset to compare against ref...
Read more >[Fixed] ModuleNotFoundError: No module named 'importlib ...
The most likely reason is that Python doesn't provide importlib-metadata in its standard library. You need to install it first! ... Before being...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

xarray.testsis listed as a import test in the conda-forge xarray-feedstock and was failing when I was doing a build. I do not think that import line needs to be present,testsdoes not seem to be in the public API of xarray. I’d be in favor of removing that line and keeping the test suite setup as-is.@shoyer Agreed, there is no need for
xarray.teststo be importable. Closing this issue, thanks for the quick clarification.