Skip to content

Commit 4c072ea

Browse files
committed
undo some debugging
1 parent 1d9e62a commit 4c072ea

File tree

4 files changed

+13
-37
lines changed

4 files changed

+13
-37
lines changed

.github/workflows/testsuite.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ jobs:
8181
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
8282
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#available-versions-of-python-and-pypy
8383
- "3.9"
84-
#- "3.10"
85-
#- "3.11"
86-
#- "3.12"
87-
#- "3.13"
88-
#- "3.13t"
84+
- "3.10"
85+
- "3.11"
86+
- "3.12"
87+
- "3.13"
88+
- "3.13t"
8989
- "3.14"
90-
#- "3.14t"
91-
#- "pypy-3.9"
92-
#- "pypy-3.10"
93-
#- "pypy-3.11"
90+
- "3.14t"
91+
- "pypy-3.9"
92+
- "pypy-3.10"
93+
- "pypy-3.11"
9494
#
9595
# If we need to exclude any combinations, do it like this:
9696
# exclude:
@@ -130,8 +130,9 @@ jobs:
130130
python -VV
131131
python -m site
132132
# For extreme debugging:
133-
python -c "import urllib.request as r; exec(r.urlopen('https://bit.ly/pydoctor').read())"
133+
# python -c "import urllib.request as r; exec(r.urlopen('https://bit.ly/pydoctor').read())"
134134
env | sort
135+
# Ideally, the system Python wouldn't have writable sitepackages.
135136
chmod u-w $(python -c "import site; print(site.getsitepackages()[0])")
136137
ls -ld $(python -c "import site; print(site.getsitepackages()[0])")
137138
whoami

coverage/files.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,7 @@ def prep_patterns(patterns: Iterable[str]) -> list[str]:
221221
def create_pth_file() -> Path | None:
222222
"""Create .pth file for measuring subprocesses."""
223223
for pth_dir in site.getsitepackages(): # pragma: part covered
224-
pth_file = Path(pth_dir) / "zzz_subcover.pth"
225-
import contextlib # DELETE ME
226-
with open("/tmp/foo.out", "a", encoding="utf-8") as f:
227-
with contextlib.redirect_stdout(f):
228-
import inspect;print("\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in inspect.stack()[99:0:-1]))
229-
print(f"{sys.executable = }")
230-
print(f"{sys.argv = }")
231-
print(f"sys.path:\n {'\n '.join(sys.path)}")
232-
print(f"{sys.prefix = }; {sys.exec_prefix = }")
233-
print(f"{site.getsitepackages() = }")
234-
print(f"PYTEST_CURRENT_TEST: {os.getenv("PYTEST_CURRENT_TEST")}")
235-
print(f"{pth_file = }")
224+
pth_file = Path(pth_dir) / "subcover.pth"
236225
try:
237226
pth_file.write_text("import coverage; coverage.process_startup()\n", encoding="utf-8")
238227
except OSError: # pragma: cant happen

tests/coveragetest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,17 +463,11 @@ def run_command_status(self, cmd: str) -> tuple[int, str]:
463463
# The invocation requests the coverage.py program. Substitute the
464464
# actual coverage.py main command name.
465465
command_words = [self.coverage_command]
466-
command_words = [sys.executable, "-m", "coverage"]
467466

468467
else:
469468
command_words = [command_name]
470469

471470
cmd = " ".join([shlex.quote(w) for w in command_words] + command_args)
472-
import contextlib # DELETE ME
473-
with open("/tmp/foo.out", "a", encoding="utf-8") as f:
474-
with contextlib.redirect_stdout(f):
475-
print(f"{command_words = }")
476-
print(f"{cmd = }")
477471

478472
self.last_command_status, self.last_command_output = run_command(cmd)
479473
print(self.last_command_output)

tests/test_process.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ def setUp(self) -> None:
13321332
self.make_file("main.py", """\
13331333
import os, os.path, sys
13341334
ex = os.path.basename(sys.executable)
1335-
os.system(sys.executable + " sub.py")
1335+
os.system(ex + " sub.py")
13361336
""")
13371337
# sub.py will write a few lines.
13381338
self.make_file("sub.py", """\
@@ -1346,15 +1346,7 @@ def test_patch_subprocess(self) -> None:
13461346
[run]
13471347
patch = subprocess
13481348
""")
1349-
import contextlib # DELETE ME
1350-
with open("/tmp/foo.out", "a", encoding="utf-8") as f:
1351-
with contextlib.redirect_stdout(f):
1352-
print(f"-- about to: coverage run main.py")
13531349
self.run_command("coverage run main.py")
1354-
import contextlib # DELETE ME
1355-
with open("/tmp/foo.out", "a", encoding="utf-8") as f:
1356-
with contextlib.redirect_stdout(f):
1357-
print(f"-- about to: coverage combine")
13581350
self.run_command("coverage combine")
13591351
self.assert_exists(".coverage")
13601352
data = coverage.CoverageData()

0 commit comments

Comments
 (0)