Skip to content

TST: Why so many conftest.py files? #10310

@pllim

Description

@pllim

Description

I see many copies of conftest.py files buried in the package. The most troubling are astropy/conftest.py and conftest.py that contain duplicated code.

  1. astropy/coordinates/tests/conftest.py
  2. astropy/table/tests/conftest.py
  3. astropy/wcs/tests/conftest.py
  4. astropy/wcs/wcsapi/conftest.py
  5. astropy/conftest.py
  6. docs/conftest.py
  7. conftest.py

Expected behavior

One and only one conftest.py at root directory.

Proposed solution

  • Move stuff from lower level conftest.py files to the root level one. Eliminated duplicate code.
  • Move subpackage specfici test helper functions into subpackage/tests/utils.py if they are not needed at the root conftest.py level.

Need to know

  • Is there a reason why proposed solution above wouldn't work?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions