GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_embed: four `InitConfigTests` tests are always skipped · Issue #161270 · python/cpython

test_embed: four InitConfigTests tests are always skipped #161270

New issue
Copy link
New issue
Copy link
Closed
Closed
test_embed: four InitConfigTests tests are always skipped#161270
Copy link
Assignees
NekoAsakura
Labels
easytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@NekoAsakura
NekoAsakura
opened on Nov 3, 2026
Issue body actions

Bug report

cpython/Lib/test/test_embed.py

Lines 1113 to 1114 in 069aac9

@unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries")
def test_init_default_config(self):

cpython/Lib/test/test_embed.py

Lines 1201 to 1202 in 069aac9

@unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries")
def test_init_compat_env(self):

cpython/Lib/test/test_embed.py

Lines 1237 to 1238 in 069aac9

@unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries")
def test_init_python_env(self):

cpython/Lib/test/test_embed.py

Lines 1962 to 1963 in 069aac9

@unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries")
def test_initconfig_api(self):

support.check_bolt_optimized is a function:

cpython/Lib/test/support/__init__.py

Lines 1059 to 1065 in 069aac9

def check_bolt_optimized():
# Always return false, if the platform is WASI,
# because BOLT optimization does not support WASM binary.
if is_wasi:
return False
config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
return '--enable-bolt' in config_args

skipIf gets the function itself, which is always true as it defines neither __bool__ nor __len__, so these four tests are skipped on every build since #128474.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-161270: fix always-skipped InitConfigTests in test_embed #161278
  • [3.15] gh-161270: Fix always-skipped InitConfigTests in test_embed (GH-161278) #161369
  • [3.14] gh-161270: Fix always-skipped InitConfigTests in test_embed (GH-161278) #161370

Activity

  1. NekoAsakura
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    easy
    on Nov 3, 2026
  2. gvanrossum commented on Nov 3, 2026

    @gvanrossum
    gvanrossum
    on Nov 3, 2026
    Member
    More actions

    Good catch. Can you submit a PR? Have you found other, similar cases that could be fixed similarly?

  3. NekoAsakura
    self-assigned this
    on Nov 3, 2026
  4. NekoAsakura commented on Nov 3, 2026

    @NekoAsakura
    NekoAsakura
    on Nov 3, 2026
    MemberAuthor
    More actions

    Will do. I did an AST scan for uncalled functions in skipIf/skipUnless, and this is the only one.

  5. vstinner commented on Nov 3, 2026

    @vstinner
    vstinner
    on Nov 3, 2026
    Member
    More actions

    Maybe skipIf() and skipUnless() of unittest should raise an assertion error if condition is a function?

  6. NekoAsakura commented on Nov 3, 2026

    @NekoAsakura
    NekoAsakura
    on Nov 3, 2026
    MemberAuthor
    More actions

    Maybe skipIf() and skipUnless() of unittest should raise an assertion error if condition is a function?

    I'd rather leave this to a linter than a runtime assert. The latter changes the public API, and may reject code like:

    cpython/Lib/test/test__locale.py

    Lines 3 to 6 in 7e3290d

    try:
    from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
    except ImportError:
    nl_langinfo = None

    cpython/Lib/test/test__locale.py

    Line 144 in 7e3290d

    @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available")

    where the condition is a callable on purpose to check availability.

    Reacted by Guido van Rossum
  7. vstinner commented on Nov 4, 2026

    @vstinner
    vstinner
    on Nov 4, 2026
    Member
    More actions

    The latter changes the public API, and may reject code like: (...)

    Crap. I should have expected that it's never so easy to change a public API :-(

    So well, it's uneasy to have a generic check to detect when skipIf() / skipUnless() is misused.

    Recently, I fixed a similar issue with @reap_threads decorator which was used on a test case class, whereas the decorator doesn't support classes. So tests were always skipped: commit 565f76f / PR gh-158937. In that case, I was able to add a check to @reap_threads to detect when it's used on a class.

  8. NekoAsakura
    added 3 commits that reference this issue on Nov 4, 2026

    Merge branch 'main' into pythongh-161270/bolt-skipif

    d0fcb2b

    Merge branch 'main' into pythongh-161270/bolt-skipif

    8bec019

    Merge branch 'main' into pythongh-161270/bolt-skipif

    d11a1f1
  9. vstinner
    added 3 commits that reference this issue on Nov 4, 2026

    gh-161270: Fix always-skipped `InitConfigTests` in `test_embed` (#161278

    9aa731f

    [3.14] gh-161270: Fix always-skipped `InitConfigTests` in `test_embed` (

    a2e9da3

    [3.15] gh-161270: Fix always-skipped `InitConfigTests` in `test_embed` (

    0d4914c
  10. NekoAsakura
    closed this as completedon Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @NekoAsakura
    NekoAsakura

Labels

easytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.