Skip to content

Make display count assertions robust - #14

Merged
anntzer merged 1 commit into
anntzer:mainfrom
Xeonacid:fix-test-output-count
Jul 9, 2026
Merged

Make display count assertions robust#14
anntzer merged 1 commit into
anntzer:mainfrom
Xeonacid:fix-test-output-count

Conversation

@Xeonacid

@Xeonacid Xeonacid commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

IPython's captured display hook output can use different execution counts depending on whether run_cell stores history. Newer IPython currently emits Out[0] for the tests' default run_cell calls, while the tests hard-code Out[1].

The exact display count is not the behavior under test here. Normalize the Out[...] prefix before comparing stdout so the tests continue to check the autoimport messages and displayed values without depending on IPython's internal prompt counter.

Validation: PYTHONPATH=src pytest -vv

IPython's captured display hook output can use different execution counts
depending on whether run_cell stores history. Newer IPython currently
emits Out[0] for the tests' default run_cell calls, while the tests
hard-code Out[1].

The exact display count is not the behavior under test here. Normalize
the Out[...] prefix before comparing stdout so the tests continue to
check the autoimport messages and displayed values without depending on
IPython's internal prompt counter.

Validation: PYTHONPATH=src pytest -vv
@anntzer

anntzer commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Thanks for the clean fix!

@anntzer
anntzer merged commit 69cade9 into anntzer:main Jul 9, 2026
9 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