Skip to content

Commit 9a3c40b

Browse files
committed
temp: debug
1 parent 3c2648a commit 9a3c40b

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.github/workflows/testsuite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
147147
- name: "Run tox for ${{ matrix.python-version }}"
148148
run: |
149-
python -m tox -- -rfsEX
149+
python -m tox -- -rfsEX -k test_process
150150
151151
- name: "Retry tox for ${{ matrix.python-version }}"
152152
if: failure()

coverage/patch.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,22 @@ def coverage_execv_patch(*args: Any, **kwargs: Any) -> Any:
9090
raise ConfigError(f"Unknown patch {patch!r}")
9191

9292

93+
PTH_EXEC = """\
94+
import sys, os
95+
print(f"{os.getcwd() = }")
96+
print(f"{sys.path = }")
97+
print(f"{os.listdir('.') = }")
98+
"""
99+
93100
def create_pth_file() -> Path | None:
94101
"""Create .pth file for measuring subprocesses."""
102+
pth_text = "import coverage; coverage.process_startup()\n"
103+
pth_text = rf"import os; exec({PTH_EXEC!r}+'\n'+{pth_text!r})"
95104
for pth_dir in site.getsitepackages(): # pragma: part covered
96105
pth_file = Path(pth_dir) / f"subcover_{os.getpid()}.pth"
106+
print(f"Writing pth at {pth_file = }")
97107
try:
98-
pth_file.write_text("import coverage; coverage.process_startup()\n", encoding="utf-8")
108+
pth_file.write_text(pth_text, encoding="utf-8")
99109
except OSError: # pragma: cant happen
100110
continue
101111
else:

tests/test_process.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,12 @@ def test_removing_directory_with_error(self) -> None:
13251325
class ProcessStartupTest(CoverageTest):
13261326
"""Test that we can measure coverage in subprocesses."""
13271327

1328+
def test_show_stuff(self):
1329+
print(f"In Test: {os.getcwd() = }")
1330+
print(f"In Test: {sys.path = }")
1331+
print(f"In Test: {os.listdir('.') = }")
1332+
1/0
1333+
13281334
def make_main_and_sub(self) -> None:
13291335
"""Create main.py and sub.py."""
13301336
# Main will run sub.py

0 commit comments

Comments
 (0)