Skip to content

Commit d0722ba

Browse files
committed
Replace the path to the standard library with a reproducible one
1 parent 8d5714d commit d0722ba

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

testing_tox/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# stdlib
3030
import re
3131
import sys
32+
import sysconfig
3233
from typing import Iterable
3334

3435
# 3rd party
@@ -64,8 +65,11 @@ def prepare_stdout(stdout: str, toxinidir: PathPlus):
6465
Given the content of ``sys.stdout`` captured from a run of ``tox``,
6566
prepare the output for regression tests.
6667
67-
This entails replacing the path ``toxindir`` with ``...``,
68-
and removing deprecation warnings generated by ``packaging``.
68+
This entails:
69+
70+
* replacing the path ``toxindir`` with ``...``
71+
* removing deprecation warnings generated by ``packaging``
72+
* replacing the path to the python stdlib with ``/usr/lib/python3.x``
6973
7074
:param stdout:
7175
:param toxinidir:
@@ -80,5 +84,9 @@ def prepare_stdout(stdout: str, toxinidir: PathPlus):
8084
'',
8185
stdout,
8286
)
87+
stdout = stdout.replace(
88+
sysconfig.get_path("stdlib"),
89+
f"/usr/lib/python{sys.version_info.major}.{sys.version_info.minor}",
90+
)
8391

8492
return stdout

0 commit comments

Comments
 (0)