Skip to content

3.12 starts to return an error when all tests in a test file are skipped #113661

Closed
@fishy

Description

@fishy

Bug report

Bug description:

See https://github.com/apache/thrift/blob/5cf71b2beec3c67a4c8452ddabbbc6ae43fff16f/lib/py/test/test_sslsocket.py for a full example, we skipped all tests in that file via:

@unittest.skip("failing SSL test to be fixed in subsequent pull request")
class TSSLSocketTest(unittest.TestCase):
    ...

On python 3.11 this is fine with:

/usr/bin/python3 test/test_sslsocket.py
sssssssssss
----------------------------------------------------------------------
Ran 11 tests in 0.000s

OK (skipped=11)

But on python 3.12, this starts to become an error:

/opt/hostedtoolcache/Python/3.12.1/x64/bin/python test/test_sslsocket.py
WARNING:thrift.transport.sslcompat:using legacy validation callback
sssssssssss
----------------------------------------------------------------------
Ran 0 tests in 0.000s

NO TESTS RAN (skipped=11)
make[1]: *** [Makefile:645: py3-test] Error 5

I have to add a not-skipped dummy test to work around this (https://github.com/apache/thrift/pull/2914/files)

Is this an intentional change? I found it weird that we consider a skipped test as a failure.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixesstdlibPython modules in the Lib dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions