Skip to content

TST: Test imports with python -OO flag #15052

Closed

Description

@pllim

Sometimes people run stuff with python -OO flag and choke on some astropy imports. Examples:

I am not sure how best to test this in a meaningful way.

Activity

  1. alchzh commented on Dec 23, 2023

    @alchzh
    Contributor

    pytest can run just fine with -OO, so we should just make sure the test suite succeeds.

    A few steps need to be taken here:

    • Replace uses of assert outside of test cases with the appropriate explicit error raise or logic. Easy to do with ruff.
    • Make sure all __doc__ manipulation is done after a check that it's not None
    • Add a skipif marker to all test cases that check docstrings / help(). This is already done in astropy/utils/tests/test_parsing.py

    Actually, I already have a branch with these changes and everything passing but I'm stuck on the side of the highway at the moment after the bus engine broke down and can't get my mobile hotspot to work.

    How many separate PRs would the maintainers like this to be?

  2. pllim commented on Dec 23, 2023

    @pllim
    MemberAuthor

    How many separate PRs would the maintainers like this to be?

    Hard to tell. If you let me know which branch on your fork these changes are in, I can compare and see.

  3. alchzh commented on Dec 24, 2023

    @alchzh
    Contributor
  4. github-actions commented on Dec 10, 2024

    @github-actions
    Contributor

    Hi humans 👋 - this issue was labeled as Close? approximately 6 hours ago. If you think this issue should not be closed, a maintainer should remove the Close? label - otherwise, I will close this issue in 7 days.

    If you believe I commented on this issue incorrectly, please report this here

  5. github-actions commented on Dec 18, 2024

    @github-actions
    Contributor

    I'm going to close this issue as per my previous message, but if you feel that this issue should stay open, then feel free to re-open and remove the Close? label.

    If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here

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

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