Skip to content

Consider configuration changes to aid in testing with --pyargs #8

@braingram

Description

@braingram

Some packages (like sunpy) run most of their CI with --pyargs where the tests can have unpredictable paths (note these are not schema tests because I think this issue is leading them to not test their schemas with this plugin):

 [gw3] [  0%] PASSED ..\..\.tox\py312\Lib\site-packages\sunpy\image\tests\test_resample.py::test_reshape 
..\..\.tox\py312\Lib\site-packages\sunpy\image\tests\test_transform.py::test_rotation[90.0-1] 
[gw2] [  0%] PASSED ..\..\.tox\py312\Lib\site-packages\sunpy\coordinates\tests\test_transformations.py::test_hci_hci 
..\..\.tox\py312\Lib\site-packages\sunpy\coordinates\tests\test_transformations.py::test_hme_gei_sunspice 

Note the including of .tox\py312\Lib. This does not place nice with the asdf_schema_root:

parser.addini("asdf_schema_root", "Root path indicating where schemas are stored")

One possibility is to change (or augment) the current path-based configuration to something uri based. Something like asdf_schema_uri_pattern with perhaps a uri pattern (supporting wildcards) that pytest-asdf-plugin will use to find schemas to test.

Pros:

  • compatible with --pyargs and non-pyargs runs
  • the plugin can check if the id matches the registered uri (which isn't guaranteed and is often tested separately)

Cons:

  • requires schemas to be registered with asdf (which I think is the case for all packages)
  • will miss bugs in schema registration where if a schema isn't registered it will be silently ignored (there is not anything that currently checks this so it's not a new issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions