]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#17065: Use process-unique key for winreg test.
authorR David Murray <rdmurray@bitdance.com>
Sun, 21 Apr 2013 14:13:43 +0000 (10:13 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sun, 21 Apr 2013 14:13:43 +0000 (10:13 -0400)
Patch by Jeremy Kloth.

Lib/test/test_winreg.py
Misc/NEWS

index 2799e19480202dbf0ed6e40ba78a6aab1147dfb4..683938acd4577b394894d684dd521209bfe2062e 100644 (file)
@@ -28,9 +28,12 @@ WIN64_MACHINE = True if machine() == "AMD64" else False
 # tests are only valid up until 6.1
 HAS_REFLECTION = True if WIN_VER < (6, 1) else False
 
-test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
+# Use a per-process key to prevent concurrent test runs (buildbot!) from
+# stomping on each other.
+test_key_base = "Python Test Key [%d] - Delete Me" % (os.getpid(),)
+test_key_name = "SOFTWARE\\" + test_key_base
 # On OS'es that support reflection we should test with a reflected key
-test_reflect_key_name = "SOFTWARE\\Classes\\Python Test Key - Delete Me"
+test_reflect_key_name = "SOFTWARE\\Classes\\" + test_key_base
 
 test_data = [
     ("Int Value",     45,                                      REG_DWORD),
index 9c651d314178082fb2009e9e0e40d51398a50204..89456d7dfc29519a6b40cbf96704ea0cb66c0b4f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,12 @@ Library
 - Issue #17526: fix an IndexError raised while passing code without filename to
   inspect.findsource().  Initial patch by Tyler Doyle.
 
+Tests
+-----
+
+- Issue #17065: Use process-unique key for winreg tests to avoid failures if
+  test is run multiple times in parallel (eg: on a buildbot host).
+
 IDLE
 ----