tests: fix test failure with msys2's Python 3.8.1-1 package
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 7 Jan 2020 03:33:49 +0000 (22:33 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 7 Jan 2020 15:25:12 +0000 (15:25 +0000)
commitb00e2e76283d6116ec75b130ef1e6c9252593e2f
tree363014660490c37fe3ea2b78208432916b6490ab
parentf1083338b127f62400f8c71608aa51be97cd8ff9
tests: fix test failure with msys2's Python 3.8.1-1 package

msys2's Python package version 3.8.1-1 produces wrong output for
PureWindowsPath's string representation.  It does this:

    >>> import pathlib
    >>> str(pathlib.PureWindowsPath('/yo/madame'))
    '/yo/madame'

When it should do this:

    >>> import pathlib
    >>> str(pathlib.PureWindowsPath('/yo/madame'))
    '\\yo\\madame'

Because of this, tests/plugins/src.ctf.fs/query/test_query_trace_info.py
is currently failing, as the Babeltrace output contains back-slashes but
the regex we produce contains forward-slashes.

The issue appears to be fixed in 3.8.1-2:

    https://github.com/msys2/MINGW-packages/commit/7ce8394ec8af3bdef83d1a24fd9a96bf8da3c154#diff-8b71128fa8f1e4e070196eeb2fc9a19d

But anyway, it's not really necessary to use PureWindowsPath and
PurePosixPath.  I changed the code to just use a version of the regex
with back-slashes when on Windows, and with front-slashes when on the
others.

Change-Id: Idcd865d87350682644a536ada95cfac161cc1182
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2733
Tested-by: jenkins <jenkins@lttng.org>
tests/plugins/src.ctf.fs/query/test_query_trace_info.py
This page took 0.024584 seconds and 4 git commands to generate.