Skip to content

Skip not properly propagated and wrongly shown as ok #139255

Closed as not planned
Closed as not planned

Description

@herostrat

Bug report

Bug description:

I have just updated a testbench from python3.8 to python3.10. To display the status of the tests I use pydev in Eclipse.

With 3.10 skipped tests are not shown as skipped in the GUI.
I debugged and disected and found this PR as the cause:
#27831
The issue for it:
#89118

I have no deep understanding for the unittest code, but I think (and debugging shows) the reason it breaks is because we clear self._outcome before we commit (if this is the right term?) the data via stopTestRun()

I do not use the skipdecorator but raise a SkipTest Exception.

I am not totally sure if the behaviour is wanted or not. I could not find a report that has a similar problem.
Pinging @serhiy-storchaka because it was your PR and it seems you know the module quite well. I could probably write a Patch so that it works for me, but I have no idea if I am just using something wrong. If you need any additional infos I am glad to help.

CPython versions tested on:

3.10

Operating systems tested on:

Windows

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Sep 23, 2025
  2. terryjreedy commented on Sep 23, 2025

    @terryjreedy
    Member

    3.12 and before only get security fixes. Please retest with 3.13 or later.

  3. added
    pendingThe issue will be closed if no feedback is provided
    on Sep 23, 2025
  4. serhiy-storchaka commented on Sep 23, 2025

    @serhiy-storchaka
    Member

    Thank you for your report, @herostrat. If I understand you correctly, you use a third-party wrapper around unittest which provides a custom TestResult. In its stopTestRun() or, more likely, stopTest() method it accesses the _outcome attribute of TestCase, but it is already cleared when these methods are called. Is it correct?

    Did you report the bug to PyDev or who provides the test runner? It is a private attribute, so the code that uses it risks to stop working in the new Python version. Its content should already be moved to the TestResult instance before these methods are called. If there are still good reasons to use _outcome, we can postpone its clearing until the stopTest() and stopTestRun() methods are called, although it will lead to more complicated code. But we need to know these reasons. We cannot change versions 3.9-3.12.

  5. StanFromIreland commented on Sep 5, 2026

    @StanFromIreland
    Member

    Closing as the author never replied to Serhiy's questions.

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

    3.10 (EOL)end of lifependingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions