]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-121973: Fix flaky test_pyrepl tests (GH-122140) (GH-122173)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Jul 2024 13:57:24 +0000 (15:57 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jul 2024 13:57:24 +0000 (15:57 +0200)
commit214b430fafc49f9977c251178c61794b4caad347
tree4f058f8b1f1bb364cc993ec3113239e2560fef70
parentae9e02c5083b59d171a18dfe77600ddd98f4b46b
[3.13] gh-121973: Fix flaky test_pyrepl tests (GH-122140) (GH-122173)

This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7a07eba0138b9858c6f2bea3cae9af0808)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/test/test_pyrepl/test_pyrepl.py