Skip to content

TEST: condition is inverted, test is alway skipped #148487

@mattip

Description

@mattip

Bug report

Bug description:

Two problems:

  • Running test_regrtest.py runs test_add_python_opts in a subprocess, but does not pass on the -v flag to show what tests were actually run
  • The condition for test_config is reversed: CPython has config_get so the test will never run.
    @unittest.skipUnless(config_get is None, 'need config_get()')

I discovered this when running on PyPy, which does not have config_get, so the test ran and errored. A bit of git archeology revelaed the condition was inverted from the time the test was created. cc @vstinner

$ python3.14 -m test test_regrtest -m test_add_python_opts -v -uall
== CPython 3.14.4 (main, Apr 8 2026, 09:50:55) [GCC 13.3.0]
== Linux-6.8.0-107-generic-x86_64-with-glibc2.39 little-endian
== Python build: release shared
== cwd: /tmp/test_python_worker_1444705æ
== CPU count: 24
== encodings: locale=UTF-8 FS=utf-8
== resources: all

Using random seed: 2956304017
0:00:00 load avg: 0.31 Run 1 test sequentially in a single process
0:00:00 load avg: 0.31 [1/1] test_regrtest
test_add_python_opts (test.test_regrtest.ArgsTestCase.test_add_python_opts) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.468s

OK
0:00:00 load avg: 0.31 [1/1] test_regrtest passed

== Tests result: SUCCESS ==

1 test OK.

Total duration: 520 ms
Total tests: run=1 (filtered)
Total test files: run=1/1 (filtered)
Result: SUCCESS

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests 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