Pytest gives error while running

Hi. I’m trying to run the pytest command in conda as explained in the Testing Guidelines.
To run the entire suite with pytest:

$ pytest
Here are the logs:
=================================================================== test session starts ===================================================================
platform win32 – Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
Matplotlib: 3.8.0
Freetype: 2.6.1
rootdir: C:\Users\Lenovo\sunpy-git
configfile: setup.cfg
testpaths: sunpy, docs
plugins: asdf-2.15.1, hypothesis-6.87.0, arraydiff-0.5.0, astropy-0.10.0, astropy-header-0.2.2, cov-4.1.0, doctestplus-1.0.0, filter-subpackage-0.1.2, mock-3.11.1, mpl-0.16.1, openfiles-0.5.0, remotedata-0.4.0, xdist-3.3.1
collected 2640 items / 3 skipped

sunpy\coordinates\ephemeris.py …
[ 0%]
sunpy\coordinates\frames.py …
[ 0%]
sunpy\coordinates\sun.py .
[ 0%]
sunpy\coordinates\transformations.py …
[ 0%]
sunpy\coordinates\utils.py …
[ 0%]
sunpy\coordinates\tests\test_ephemeris.py …ssss
[ 0%]
sunpy\coordinates\tests\test_frameattributes.py …
[ 1%]
sunpy\coordinates\tests\test_frames.py … [ 4%]

[ 4%]
sunpy\coordinates\tests\test_metaframes.py …
[ 5%]
sunpy\coordinates\tests\test_offset_frame.py …
[ 5%]
sunpy\coordinates\tests\test_sun.py …
[ 8%]
sunpy\coordinates\tests\test_transformations.py … [ 10%]

[ 10%]
sunpy\coordinates\tests\test_utils.py …
[ 11%]
sunpy\coordinates\tests\test_wcs_utils.py …ss…
[ 12%]
sunpy\data\data_manager\manager.py s
[ 12%]
sunpy\data\data_manager\tests\test_cache.py …
[ 13%]
sunpy\data\data_manager\tests\test_downloader.py .
[ 13%]
sunpy\data\data_manager\tests\test_manager.py …
[ 13%]
sunpy\data\data_manager\tests\test_storage.py …
[ 13%]
sunpy\data\tests\test_sample.py ss
[ 14%]
sunpy\database\database.py .s…
[ 14%]
sunpy\database\tables.py …
[ 14%]
sunpy\database\tests\test_attrs.py …sss
[ 15%]
sunpy\database\tests\test_caching.py …
[ 15%]
sunpy\database\tests\test_commands.py …
[ 16%]
sunpy\database\tests\test_database.py …sssssssssss… [ 19%]
.sss.ssss…
[ 19%]
sunpy\database\tests\test_tables.py …ssssss…sss…
[ 20%]
sunpy\image\tests\test_resample.py …
[ 21%]
sunpy\image\tests\test_transform.py …
[ 23%]
sunpy\io_fits.py .
[ 23%]
sunpy\io\ana.py sss
[ 23%]
sunpy\io\special\asdf\resources\manifests\sunpy-1.0.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\generic_map-1.0.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\generic_map-1.1.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\geocentricearthequatorial-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\geocentricsolarecliptic-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentric-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentricearthecliptic-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentricinertial-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.1.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.2.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_stonyhurst-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_stonyhurst-1.1.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\helioprojective-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\tests\test_coordinate_frames.py …
[ 25%]
sunpy\io\special\asdf\tests\test_genericmap.py …Windows fatal exception: access violation

Current thread 0x000020a4 (most recent call first):
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 936 in fillFormat
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 932 in init
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 411 in
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 472 in _get_format_function
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 539 in _array2string
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 513 in wrapper
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 736 in array2string
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 1508 in _array_repr_implementation
File “C:\Users\Lenovo\sunpy-git\sunpy\map\mapbase.py”, line 304 in str
File “C:\Users\Lenovo\sunpy-git\sunpy\map\mapbase.py”, line 307 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 76 in repr_instance
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py”, line 63 in repr1
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py”, line 53 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 64 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 115 in saferepr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 763 in repr_args
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 859 in repr_traceback_entry
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 914 in
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 913 in repr_traceback
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 989 in repr_excinfo
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 701 in getrepr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\nodes.py”, line 486 in _repr_failure_py
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\python.py”, line 1833 in repr_failure
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\reports.py”, line 362 in from_item_and_call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 368 in pytest_runtest_makereport
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 224 in call_and_report
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 133 in runtestprotocol
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 114 in pytest_runtest_protocol
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 350 in pytest_runtestloop
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 325 in main
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 271 in wrap_session
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 318 in pytest_cmdline_main
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\config_init
.py", line 169 in main
File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\config_init
.py", line 192 in console_main File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Scripts\pytest.exe_main
.py", line 7 in
File “”, line 88 in _run_code
File “”, line 198 in _run_module_as_main

(sunpy-dev) C:\Users\Lenovo\sunpy-git>pytest
=================================================================== test session starts ===================================================================
platform win32 – Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
Matplotlib: 3.8.0
Freetype: 2.6.1
rootdir: C:\Users\Lenovo\sunpy-git
configfile: setup.cfg
testpaths: sunpy, docs
plugins: asdf-2.15.1, hypothesis-6.87.0, arraydiff-0.5.0, astropy-0.10.0, astropy-header-0.2.2, cov-4.1.0, doctestplus-1.0.0, filter-subpackage-0.1.2, mock-3.11.1, mpl-0.16.1, openfiles-0.5.0, remotedata-0.4.0, xdist-3.3.1
collected 2640 items / 3 skipped

sunpy\coordinates\ephemeris.py …
[ 0%]
sunpy\coordinates\frames.py …
[ 0%]
sunpy\coordinates\sun.py .
[ 0%]
sunpy\coordinates\transformations.py …
[ 0%]
sunpy\coordinates\utils.py …
[ 0%]
sunpy\coordinates\tests\test_ephemeris.py …ssss
[ 0%]
sunpy\coordinates\tests\test_frameattributes.py …
[ 1%]
sunpy\coordinates\tests\test_frames.py …
[ 4%]
sunpy\coordinates\tests\test_metaframes.py …
[ 5%]
sunpy\coordinates\tests\test_offset_frame.py …
[ 5%]
sunpy\coordinates\tests\test_sun.py …
[ 8%]
sunpy\coordinates\tests\test_transformations.py …
[ 10%]
sunpy\coordinates\tests\test_utils.py …
[ 11%]
sunpy\coordinates\tests\test_wcs_utils.py …ss…
[ 12%]
sunpy\data\data_manager\manager.py s
[ 12%]
sunpy\data\data_manager\tests\test_cache.py …
[ 13%]
sunpy\data\data_manager\tests\test_downloader.py .
[ 13%]
sunpy\data\data_manager\tests\test_manager.py …
[ 13%]
sunpy\data\data_manager\tests\test_storage.py …
[ 13%]
sunpy\data\tests\test_sample.py ss
[ 14%]
sunpy\database\database.py .s…
[ 14%]
sunpy\database\tables.py …
[ 14%]
sunpy\database\tests\test_attrs.py …sss
[ 15%]
sunpy\database\tests\test_caching.py …
[ 15%]
sunpy\database\tests\test_commands.py …
[ 16%]
sunpy\database\tests\test_database.py …sssssssssss…sss.ssss…
[ 19%]
sunpy\database\tests\test_tables.py …ssssss…sss…
[ 20%]
sunpy\image\tests\test_resample.py …
[ 21%]
sunpy\image\tests\test_transform.py …
[ 23%]
sunpy\io_fits.py .
[ 23%]
sunpy\io\ana.py sss
[ 23%]
sunpy\io\special\asdf\resources\manifests\sunpy-1.0.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\generic_map-1.0.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\generic_map-1.1.0.yaml .
[ 23%]
sunpy\io\special\asdf\resources\schemas\geocentricearthequatorial-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\geocentricsolarecliptic-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentric-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentricearthecliptic-1.0.0.yaml …
[ 23%]
sunpy\io\special\asdf\resources\schemas\heliocentricinertial-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.1.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_carrington-1.2.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_stonyhurst-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\heliographic_stonyhurst-1.1.0.yaml …
[ 24%]
sunpy\io\special\asdf\resources\schemas\helioprojective-1.0.0.yaml …
[ 24%]
sunpy\io\special\asdf\tests\test_coordinate_frames.py …
[ 25%]
sunpy\io\special\asdf\tests\test_genericmap.py …Windows fatal exception: access violation

Current thread 0x00001888 (most recent call first):
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 936 in fillFormat
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 932 in init
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 411 in
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 472 in _get_format_function
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 539 in _array2string
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 513 in wrapper
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 736 in array2string
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\numpy\core\arrayprint.py”, line 1508 in _array_repr_implementation
File “C:\Users\Lenovo\sunpy-git\sunpy\map\mapbase.py”, line 304 in str
File “C:\Users\Lenovo\sunpy-git\sunpy\map\mapbase.py”, line 307 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 76 in repr_instance
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py”, line 63 in repr1
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py”, line 53 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 64 in repr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_io\saferepr.py”, line 115 in saferepr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 763 in repr_args
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 859 in repr_traceback_entry
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 914 in
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 913 in repr_traceback
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 989 in repr_excinfo
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest_code\code.py”, line 701 in getrepr
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\nodes.py”, line 486 in _repr_failure_py
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\python.py”, line 1833 in repr_failure
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\reports.py”, line 362 in from_item_and_call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 368 in pytest_runtest_makereport
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 224 in call_and_report
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 133 in runtestprotocol
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\runner.py”, line 114 in pytest_runtest_protocol
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 350 in pytest_runtestloop
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in _multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in _hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 325 in main
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 271 in wrap_session
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\main.py”, line 318 in pytest_cmdline_main
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_callers.py”, line 77 in multicall
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_manager.py”, line 115 in hookexec
File “C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pluggy_hooks.py”, line 493 in call
File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\config_init
.py", line 169 in main
File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages_pytest\config_init
.py", line 192 in console_main
File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Scripts\pytest.exe_main
.py", line 7 in
File “”, line 88 in _run_code
File “”, line 198 in _run_module_as_main

Hmm, that is a strange error but I think it comes from: sunpy\io\special\asdf\tests\test_genericmap.py

Can you run just pyetst sunpy\io\special\asdf\tests\test_genericmap.py and see if that errors now?

I would also try using tox instead, the instructions should be on that page as well. Hopefully in a fully isolated env it will be more cooperative.

It seems we have more problems under Windows than anticipated and we will need to track those down.

Hello, did that again with pytest sunpy\io\special\asdf\tests\test_genericemap.py and shows the same problem.

I also did tox(they showed a msg that it couldn’t be recognized so I did pip install tox)
I ran tox -e py311 and it shows an error but this time not with sunpy\io\special\asdf\tests\test_genericmap.py

The logs are too large, so I’m only showing the logs from just before it throughs an error.

..\..\.tox\py311\Lib\site-packages\sunpy\io\special\asdf\tests\test_coordinate_frames.py::test_hcc_observer_version PASSED                                                   [ 24%]
..\..\.tox\py311\Lib\site-packages\sunpy\io\special\asdf\tests\test_genericmap.py::test_genericmap_basic PASSED
                                                     [ 24%]
..\..\.tox\py311\Lib\site-packages\sunpy\io\special\asdf\tests\test_genericmap.py::test_genericmap_mask PASSED
                                                     [ 24%]
..\..\.tox\py311\Lib\site-packages\sunpy\io\special\asdf\tests\test_genericmap.py::test_load_100_file_with_shift Windows fatal exception: access violation

Current thread 0x000034dc (most recent call first):
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 936 in fillFormat
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 932 in __init__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 411 in <lambda>
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 472 in _get_format_function
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 539 in _array2string
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 513 in wrapper
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 736 in array2string
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\numpy\core\arrayprint.py", line 1508 in _array_repr_implementation
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\sunpy\map\mapbase.py", line 304 in __str__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\sunpy\map\mapbase.py", line 307 in __repr__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_io\saferepr.py", line 76 in repr_instance
  File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py", line 63 in repr1
  File "C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\reprlib.py", line 53 in repr
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_io\saferepr.py", line 64 in repr
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_io\saferepr.py", line 115 in saferepr
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 763 in repr_args
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 859 in repr_traceback_entry
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 914 in <listcomp>
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 913 in repr_traceback
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 989 in repr_excinfo
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\_code\code.py", line 701 in getrepr
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\nodes.py", line 486 in _repr_failure_py
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\python.py", line 1833 in repr_failure
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\reports.py", line 362 in from_item_and_call
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\runner.py", line 368 in pytest_runtest_makereport
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_callers.py", line 77 in _multicall
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_manager.py", line 115 in _hookexec
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_hooks.py", line 493 in __call__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\runner.py", line 224 in call_and_report
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\runner.py", line 133 in runtestprotocol
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\runner.py", line 114 in pytest_runtest_protocol
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_callers.py", line 77 in _multicall
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_manager.py", line 115 in _hookexec
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_hooks.py", line 493 in __call__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\main.py", line 350 in pytest_runtestloop
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_callers.py", line 77 in _multicall
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_manager.py", line 115 in _hookexec
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_hooks.py", line 493 in __call__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\main.py", line 325 in _main
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\main.py", line 271 in wrap_session
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\main.py", line 318 in pytest_cmdline_main
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_callers.py", line 77 in _multicall
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_manager.py", line 115 in _hookexec
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\pluggy\_hooks.py", line 493 in __call__
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\config\__init__.py", line 169 in main
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Lib\site-packages\_pytest\config\__init__.py", line 192 in console_main
  File "C:\Users\Lenovo\Desktop\sunpy-git\.tox\py311\Scripts\pytest.EXE\__main__.py", line 7 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main
py311: exit 3221225477 (42.00 seconds) C:\Users\Lenovo\Desktop\sunpy-git\.tmp\py311> pytest -vvv -r a --pyargs sunpy --cov-report=xml --cov=sunpy --cov-config=C:\Users\Lenovo\Desktop\sunpy-git/setup.cfg C:\Users\Lenovo\Desktop\sunpy-git/docs pid=7980
.pkg: _exit> python C:\Users\Lenovo\anaconda3\envs\sunpy-dev\Lib\site-packages\pyproject_api\_backend.py True setuptools.build_meta
  py311: FAIL code 3221225477 (76.75=setup[34.08]+cmd[0.67,42.00] seconds)
  evaluation failed :( (76.86 seconds)

Looks like there is some specific Window and ASDF/numpy interaction that is breaking on your local machine.

I don’t have any good ideas as to what is happening or how to fix it but these are very specific unit tests, that I think its ok for you to ignore it locally for the time being.

You can in future, using pytest, just pass in the file or folder you want to test instead of the entire test suite while we try to work out what is going on here.

I’ve tried to replicate your issue on my Windows machine with no success. I wonder if this is related to removes incorrect block indices from asdf test data by braingram · Pull Request #7145 · sunpy/sunpy · GitHub. What version of asdf is being installed, and what version/branch of sunpy are you running the test on?

Hello, can you clarify what asdf is cause I see it in ‘sunpy/io/special/asdf’ but in the command line it is not recognized.
Also while setting the developer environment, the command pip install -e .[dev] was throwing errors so I ended up using pip install -e .[all,tests] as I was suggested in the sunpy-chat.
(I forked the repository and created a local branch which is up to date and not behind as of today).

Hello,

I just noticed that you are using anaconda, I would strongly recommend you switch to miniforge (GitHub - conda-forge/miniforge: A conda-forge distribution.) and there is a conda enviromfental file in the sunpy repository to setup a full development environment.

can you clarify what asdf is cause I see it in ‘sunpy/io/special/asdf’ but in the command line it is not recognized.

ASDF is a special file format for storing scientific data. I actually do not know if you can call a reader from the command line.

Also while setting the developer environment, the command pip install -e .[dev] was throwing errors so I ended up using pip install -e .[all,tests] as I was suggested in the sunpy-chat.

Yeah, that was unfortunately due to our documentation requirements, which is installed by the “dev” category, requiring mpl-cario and that needs a library to be manually installed for Python 3.11.

If I’m not wrong you are suggesting to use conda config --add channels conda-forge in conda. If so I tried that as well but the error still exists.

I did everything from start in my linux environment and all the issues remained just as it is, running pytest still showed some error with the test_genericmap.py. Thus this issue may not be specifically windows related.

I used conda this time as well.

Argh. Can you please give the output of conda list?

Sure, you can see the complete output in drive link. here

Hmm, nothing obvious jumps out at me in the conda environment. It’s puzzling that you’re encountering the issue on both Windows and Linux. Are you using the same literal files for the sunpy repository for both platforms (e.g., on a common shared filesystem)? I wonder if the test file is somehow corrupted.

Can you try decorating that specific test (test_genericmap.py::test_load_100_file_with_shift) with @pytest.mark.skip? I imagine you’ll find that you need to also skip the subsequent test (test_genericmap.py::test_load_100_file_with_no_shift). The goal is to figure out all the tests that are failing for you, and it’s critical to get the test run to stop crashing.

I decorated with @pytest.mark.skip and pytest ran without throwing any errors.
output was:
2408 passed, 241 skipped, 1 xfailed .
thnx for the suggestions.