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

Skip to content

Commit 4140fb5

Browse files
committed
#17065: Use process-unique key for winreg test.
Patch by Jeremy Kloth.
1 parent 637c7c4 commit 4140fb5

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
@@ -124,6 +124,9 @@ IDLE
124124
Tests
125125
-----
126126

127+
- Issue #17065: Use process-unique key for winreg tests to avoid failures if
128+
test is run multiple times in parallel (eg: on a buildbot host).
129+
127130
- Issue #12820: add tests for the xml.dom.minicompat module.
128131
Patch by John Chandler and Phil Connell.
129132

0 commit comments

Comments
 (0)