Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3927d80

Browse files
committed
Merge #17065: Use process-unique key for winreg test.
Patch by Jeremy Kloth.
2 parents 4fe2184 + 4140fb5 commit 3927d80

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/test/test_winreg.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@
2828
# tests are only valid up until 6.1
2929
HAS_REFLECTION = True if WIN_VER < (6, 1) else False
3030

31-
test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
31+
# Use a per-process key to prevent concurrent test runs (buildbot!) from
32+
# stomping on each other.
33+
test_key_base = "Python Test Key [%d] - Delete Me" % (os.getpid(),)
34+
test_key_name = "SOFTWARE\\" + test_key_base
3235
# On OS'es that support reflection we should test with a reflected key
33-
test_reflect_key_name = "SOFTWARE\\Classes\\Python Test Key - Delete Me"
36+
test_reflect_key_name = "SOFTWARE\\Classes\\" + test_key_base
3437

3538
test_data = [
3639
("Int Value", 45, REG_DWORD),

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ Library
141141
Tests
142142
-----
143143

144+
- Issue #17065: Use process-unique key for winreg tests to avoid failures if
145+
test is run multiple times in parallel (eg: on a buildbot host).
146+
144147
- Issue #12820: add tests for the xml.dom.minicompat module.
145148
Patch by John Chandler and Phil Connell.
146149

0 commit comments

Comments
 (0)