Skip to content

Fix Python 3.11 test failures and mask-free CI failure reporting#34

Merged
gb119 merged 4 commits intostablefrom
copilot/increase-test-coverage
Mar 20, 2026
Merged

Fix Python 3.11 test failures and mask-free CI failure reporting#34
gb119 merged 4 commits intostablefrom
copilot/increase-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Two bugs caused Python 3.11 CI runs to silently report 158 test failures as success.

super() in list comprehension — Python 3.11 incompatibility

In Python ≤ 3.11, list comprehensions run in a nested function scope. Bare super() relies on a __class__ cell that isn't propagated into that scope, raising TypeError: super(type, obj): obj must be an instance or subtype of type. PEP 709 (Python 3.12) inlined comprehensions, which is why this only breaks on 3.11.

Stoner/core/base.pyTypeHintedDict.__getitem__:

# Before — fails on Python 3.11
value = [super().__getitem__(nm) for nm in name]

# After — capture super() in enclosing scope first
_super = super()
value = [_super.__getitem__(nm) for nm in name]

CI exit-code masking

The "Test with xvfb" step runs under bash -l {0} (no -e). When pytest exits non-zero, coverage xml still runs and returns 0, so the step — and the whole job — reports success despite test failures.

.github/workflows/run-tests-action.yaml:

# Before
xvfb-run --auto-servernum pytest -n 2 --cov-report= --cov=Stoner --junitxml pytest.xml
coverage xml

# After — propagate pytest's exit code while still generating coverage
xvfb-run --auto-servernum pytest -n 2 --cov-report= --cov=Stoner --junitxml pytest.xml || PYTEST_EXIT=$?
coverage xml
exit ${PYTEST_EXIT:-0}

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI and others added 2 commits March 20, 2026 21:58
…st-coverage

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Copilot AI changed the title [WIP] Add additional tests to increase coverage on stable branch Increase test coverage on stable branch Mar 20, 2026
Copilot AI requested a review from gb119 March 20, 2026 22:36
@github-actions
Copy link
Copy Markdown

Test Results

    4 files  +  1      4 suites  +1   22m 55s ⏱️ + 5m 3s
  337 tests + 46    161 ✅ + 46  0 💤 ±0  158 ❌ ±0  18 🔥 ±0 
1 284 runs  +469  1 103 ✅ +469  0 💤 ±0  158 ❌ ±0  23 🔥 ±0 

For more details on these failures and errors, see this check.

Results for commit 114151a. ± Comparison against base commit 6cb282d.

Copilot AI changed the title Increase test coverage on stable branch Fix Python 3.11 test failures and mask-free CI failure reporting Mar 20, 2026
@gb119 gb119 changed the base branch from main to stable March 20, 2026 23:39
@gb119 gb119 marked this pull request as ready for review March 20, 2026 23:39
@gb119 gb119 merged commit fd2aae8 into stable Mar 20, 2026
11 of 12 checks passed
@gb119 gb119 deleted the copilot/increase-test-coverage branch March 20, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants