diff mbox series

[ovs-dev,v2] tests: Fix compatibility issue with Python 3.13 in vlog.at.

Message ID 20240408212414.16704-1-fnordahl@ubuntu.com
State Accepted
Commit 9185793e75435d890f18d391eaaeab0ade6f1415
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,v2] tests: Fix compatibility issue with Python 3.13 in vlog.at. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Frode Nordahl April 8, 2024, 9:24 p.m. UTC
The vlog - Python3 test makes use of output from Python
Tracebacks in its test assertion.

In Python 3.13 a line with tophat (``^``) markers is added below
Tracebacks from calls to assert [0], which makes the test fail.
This change of behavior is also backported to the Python 3.12 and
3.11 stable branches [1].

Strip lines containing one or more occurence of the ``^``
character from the output before performing the test assertions.

0: https://github.com/python/cpython/pull/105935
1: https://github.com/python/cpython/issues/116034
Reported-at: https://launchpad.net/bugs/2060434
Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
---
 tests/vlog.at | 1 +
 1 file changed, 1 insertion(+)

Comments

Ilya Maximets April 9, 2024, 9:27 p.m. UTC | #1
On 4/8/24 23:24, Frode Nordahl wrote:
> The vlog - Python3 test makes use of output from Python
> Tracebacks in its test assertion.
> 
> In Python 3.13 a line with tophat (``^``) markers is added below
> Tracebacks from calls to assert [0], which makes the test fail.
> This change of behavior is also backported to the Python 3.12 and
> 3.11 stable branches [1].
> 
> Strip lines containing one or more occurence of the ``^``
> character from the output before performing the test assertions.
> 
> 0: https://github.com/python/cpython/pull/105935
> 1: https://github.com/python/cpython/issues/116034
> Reported-at: https://launchpad.net/bugs/2060434
> Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
> ---
>  tests/vlog.at | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/vlog.at b/tests/vlog.at
> index 785014956..efe91479a 100644
> --- a/tests/vlog.at
> +++ b/tests/vlog.at
> @@ -8,6 +8,7 @@ AT_CHECK([$PYTHON3 $srcdir/test-vlog.py --log-file log_file \
>  
>  AT_CHECK([sed -e 's/.*-.*-.*T..:..:..Z |//' \
>  -e 's/File ".*", line [[0-9]][[0-9]]*,/File <name>, line <number>,/' \
> +-e '/\^\+/d' \
>  stderr_log], [0], [dnl
>    0  | module_0 | EMER | emergency
>    1  | module_0 | ERR | error

Thanks!  Applied to all branches down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/tests/vlog.at b/tests/vlog.at
index 785014956..efe91479a 100644
--- a/tests/vlog.at
+++ b/tests/vlog.at
@@ -8,6 +8,7 @@  AT_CHECK([$PYTHON3 $srcdir/test-vlog.py --log-file log_file \
 
 AT_CHECK([sed -e 's/.*-.*-.*T..:..:..Z |//' \
 -e 's/File ".*", line [[0-9]][[0-9]]*,/File <name>, line <number>,/' \
+-e '/\^\+/d' \
 stderr_log], [0], [dnl
   0  | module_0 | EMER | emergency
   1  | module_0 | ERR | error