diff options
author | prettyboy <prettyboy@yandex-team.com> | 2025-01-30 09:41:16 +0300 |
---|---|---|
committer | prettyboy <prettyboy@yandex-team.com> | 2025-01-30 10:01:32 +0300 |
commit | 63389c48bc8b9423279edaea502967abc8126bbc (patch) | |
tree | 54ad829273e1a2521fa035b533a732f72be75b22 | |
parent | fe03be72912edb2b13562322ddb6af2e10781f17 (diff) | |
download | ydb-63389c48bc8b9423279edaea502967abc8126bbc.tar.gz |
[build/plugins/pybuild] Avoid collision in module names in venv mode
commit_hash:c46828a2ae03a161b7aa2cc514ee2d83ac5d4c08
-rw-r--r-- | build/plugins/pybuild.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index 2870869c84..2a1add15ae 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -672,7 +672,11 @@ def _check_test_srcs(*args): def ontest_srcs(unit, *args): _check_test_srcs(*args) if unit.get('PY3TEST_BIN' if is_py3(unit) else 'PYTEST_BIN') != 'no': - unit.onpy_srcs(["NAMESPACE", "__tests__"] + list(args)) + namespace = "__tests__" + # Avoid collision on test modules in venv mode + if unit.get('YA_IDE_VENV'): + namespace += "." + unit.path()[3:].replace('/', '.') + unit.onpy_srcs(["NAMESPACE", namespace] + list(args)) def onpy_doctests(unit, *args): |