Skip to content

Commit 284c99b

Browse files
committed
Concurrent custom branch check
1 parent ed9a34f commit 284c99b

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
path: |
118118
hypothesis-python/.coverage*
119119
!hypothesis-python/.coveragerc
120-
hypothesis-python/branch-check
120+
hypothesis-python/branch-check*
121121
122122
test-win:
123123
runs-on: windows-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# generic build components
1212

1313
.runtimes
14-
/hypothesis-python/branch-check
14+
/hypothesis-python/branch-check*
1515
/pythonpython3.*
1616
/pythonpypy3.*
1717
.pyodide-xbuildenv

hypothesis-python/scripts/validate_branch_check.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import json
1212
import sys
1313
from collections import defaultdict
14+
from pathlib import Path
1415

1516
if __name__ == "__main__":
16-
with open("branch-check", encoding="utf-8") as i:
17-
data = [json.loads(l) for l in i]
17+
data = []
18+
for p in Path.cwd().glob("branch-check*"):
19+
data.extend(json.loads(l) for l in p.read_text("utf-8").splitlines())
1820

1921
checks = defaultdict(set)
2022

hypothesis-python/src/hypothesis/internal/coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def record_branch(name, value):
6161
if key in written:
6262
return
6363
written.add(key)
64-
with open("branch-check", mode="a", encoding="utf-8") as log:
64+
with open(f"branch-check-{os.getpid()}", mode="a", encoding="utf-8") as log:
6565
log.write(json.dumps({"name": name, "value": value}) + "\n")
6666

6767
description_stack = []

hypothesis-python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ setenv=
166166
PYTHONWARNDEFAULTENCODING=1
167167
HYPOTHESIS_INTERNAL_COVERAGE=true
168168
commands_pre =
169-
rm -f branch-check
169+
rm -f branch-check*
170170
pip install .[zoneinfo]
171171
# Produce a coverage report even if the test suite fails.
172172
# (The tox task will still count as failed.)

0 commit comments

Comments
 (0)