Skip to content

pytest -P <module> no longer works! #20163

Closed

Description

@mhvk

Description

See title; for me, this is important workflow, mostly as it ensures docs of the module are tested too.

I suspect #18784, so pinging @neutrinoceros.

Expected behavior

No response

How to Reproduce

  1. Get package from '...'
  2. Then run '...'
  3. An error occurs.
# Put your Python code snippet here.

Versions

import astropy
astropy.system_info()
# Paste the result here

Activity

  1. neutrinoceros commented on Jul 30, 2026

    @neutrinoceros
    Contributor

    This is because I removed pytest-filter-subpackage as an unused dependency. Is it good enough for you to require it manually ?

  2. added
    dependenciesPull requests that update a dependency file
    and removed on Jul 30, 2026
  3. neutrinoceros commented on Jul 30, 2026

    @neutrinoceros
    Contributor

    btw I'm not sure I understand what value this plugin adds when one can achieve the same thing with pytest {astropy,docs}/units

  4. astrofrog commented on Jul 30, 2026

    @astrofrog
    Member

    I use this too - and like using it in combination with tox, so e.g.

    tox -e test -- -P time
    

    not sure that passing the paths as you suggest would work since tox might be in a temp directory. Could we reinstate this? There was strong demand for this plugin when we deprecated astropy-helpers.

    (requiring it manually would require editing the tox file)

  5. neutrinoceros commented on Jul 30, 2026

    @neutrinoceros
    Contributor

    It could easily be re-added as part of a dependency-group that all tox envs would require. Would that be satisfactory ?

  6. mhvk commented on Jul 30, 2026

    @mhvk
    ContributorAuthor

    I think just re-adding it as a test dependency would make the most sense. I know @pllim usually just creates a virtual enviroment and then does something like pip install .[test].

  7. pllim commented on Jul 30, 2026

    @pllim
    Member

    We should just add it back as a proper test dependency. It is a lightweight package and maintained by our own project.

    https://github.com/astropy/pytest-filter-subpackage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filetesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions