Skip to content

TST: Handle test warnings #65

@pllim

Description

@pllim

Example log: https://github.com/Jammy2211/PyAutoGalaxy/runs/7808313167?check_suite_focus=true

In the log above, there are 59 warnings.

  • Most of them are deprecation warnings (which indicate the code needs to catch up or risk being broken when new upstream releases are made).
  • The PytestAssertRewriteWarning: assertion is always true looks like a testing bug and needs to be fixed.
  • Not sure what UserWarning is about but might be a bug too.

Bonus: Turn all pytest warnings into failures and explicitly handle them (either ignore on purpose globally or on a case-by-case basis for reason beyond your control, or mark them as expected warning using pytest.warns, or fix the use case so warning does not get raised at all).

Also see https://docs.pytest.org/en/stable/how-to/capture-warnings.html

astropy/astropy.github.com#491 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions