Skip to content

fix(testing): clear watch screen via Console, not deprecated os.system#3102

Merged
marioevz merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:fix/execution-testing-mypy
Jul 3, 2026
Merged

fix(testing): clear watch screen via Console, not deprecated os.system#3102
marioevz merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:fix/execution-testing-mypy

Conversation

@chfast

@chfast chfast commented Jul 3, 2026

Copy link
Copy Markdown
Member

🗒️ Description

mypy's deprecated error code (enabled in pyproject.toml) flags the os.system call in the --watch file watcher. Use the Rich Console.clear() the watcher already holds instead of shelling out to clear/cls; it is cross-platform and removes the last os use, so drop import os.

Why CI does not catch this: typeshed marks os.system @deprecated only for sys.version_info >= (3, 14), and [tool.mypy] pins no python_version, so mypy targets whatever interpreter runs it. The static CI job has no setup-python step (unlike the fill jobs, which pin 3.14) and runs mypy under the runner default, CPython 3.13, where the marker is inactive. Local dev on 3.14 sees the error; CI stays green.

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Verifying Changes:
    just static
  • All: PR title have the form <type>(<area>):, where <type> and <area> come from an approrpriate C-<type>, respectively A-<area>, label. The title should match the a target squash commit message.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: Add the following docstring to manually enhanced tests from ./tests/ported_static/:
    @manually-enhanced: Do not overwrite. Post-state expectations corrected
    manually (see PR #2784).
    

mypy's `deprecated` error code (enabled in pyproject.toml) flags the
`os.system` call in the `--watch` file watcher. Use the Rich
`Console.clear()` the watcher already holds instead of shelling out to
`clear`/`cls`; it is cross-platform and removes the last `os` use, so
drop `import os`.

Why CI does not catch this: typeshed marks `os.system` `@deprecated`
only for `sys.version_info >= (3, 14)`, and `[tool.mypy]` pins no
`python_version`, so mypy targets whatever interpreter runs it. The
`static` CI job has no setup-python step (unlike the fill jobs, which
pin 3.14) and runs mypy under the runner default, CPython 3.13, where
the marker is inactive. Local dev on 3.14 sees the error; CI stays
green.

Claude-Session: https://claude.ai/code/session_01Nw3qUNd4aNzVypuzNhbQyg
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.30%. Comparing base (7603ff6) to head (fb06cfc).
⚠️ Report is 2 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #3102      +/-   ##
===================================================
+ Coverage            93.24%   93.30%   +0.05%     
===================================================
  Files                  624      624              
  Lines                36986    36986              
  Branches              3383     3383              
===================================================
+ Hits                 34489    34511      +22     
+ Misses                1704     1693      -11     
+ Partials               793      782      -11     
Flag Coverage Δ
unittests 93.30% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marioevz marioevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@marioevz marioevz merged commit f188d01 into ethereum:forks/amsterdam Jul 3, 2026
24 checks passed
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