From 3906e0c28caa8ad7964ddafd9a9dc54125b2c4f8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 20 Nov 2021 11:40:46 -0300 Subject: [PATCH] WIP more prints --- src/_pytest/assertion/rewrite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index b1ffac3e9..bd3545f8f 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -1150,7 +1150,8 @@ def get_cache_dir(file_path: Path) -> Path: # path = '/home/user/proj/test_app.py' # we want: # '/tmp/pycs/home/user/proj' - return Path(sys.pycache_prefix) / Path(*file_path.parts[1:-1]) + # HACK skip some parts to check if long paths are a problem. + return Path(sys.pycache_prefix) / Path(*file_path.parts[1:-1:2]) else: # classic pycache directory return file_path.parent / "__pycache__"