Browse Source

tests: use unique, non-interned keys for property refcount tests

There is an intermittent build failure and I suspect it's because the keys are too generic and are interned, and thus may have their refcount incremented or decremented by some other (background?) process.
rdb 5 years ago
parent
commit
508444d27f
1 changed files with 12 additions and 12 deletions
  1. 12 12
      tests/interrogate/test_property.py

+ 12 - 12
tests/interrogate/test_property.py

@@ -149,7 +149,7 @@ def test_seq_property_getitem():
         prop[i]
         prop[i]
 
 
     # Make sure it preserves refcount of invalid indices
     # Make sure it preserves refcount of invalid indices
-    i = "nonsense"
+    i = "nonsense195641"
     with constant_refcount(i):
     with constant_refcount(i):
         try:
         try:
             prop[i]
             prop[i]
@@ -250,7 +250,7 @@ def test_seq_property_index():
         except ValueError:
         except ValueError:
             pass
             pass
 
 
-    nonsense = "nonsense"
+    nonsense = "nonsense854371"
     with constant_refcount(nonsense):
     with constant_refcount(nonsense):
         try:
         try:
             prop.index(nonsense)
             prop.index(nonsense)
@@ -271,7 +271,7 @@ def test_seq_property_count():
     with constant_refcount(item_b):
     with constant_refcount(item_b):
         prop.count(item_b)
         prop.count(item_b)
 
 
-    nonsense = "nonsense"
+    nonsense = "nonsense219449"
     with constant_refcount(nonsense):
     with constant_refcount(nonsense):
         prop.count(nonsense)
         prop.count(nonsense)
 
 
@@ -447,8 +447,8 @@ def test_map_property_empty():
 
 
 
 
 def test_map_property_getitem():
 def test_map_property_getitem():
-    key = 'key'
-    value = 'value'
+    key = 'key162732'
+    value = 'value162732'
     prop = map_property(**{key: value})
     prop = map_property(**{key: value})
 
 
     with constant_refcount(key):
     with constant_refcount(key):
@@ -462,8 +462,8 @@ def test_map_property_getitem():
 
 
 
 
 def test_map_property_setitem():
 def test_map_property_setitem():
-    key = 'key'
-    value = 'value'
+    key = 'key559075'
+    value = 'value559075'
     prop = map_property()
     prop = map_property()
 
 
     # Setting new key
     # Setting new key
@@ -490,8 +490,8 @@ def test_map_property_setitem():
 
 
 
 
 def test_map_property_delitem():
 def test_map_property_delitem():
-    key = 'key'
-    value = 'value'
+    key = 'key731691'
+    value = 'value731691'
     prop = map_property(**{key: value})
     prop = map_property(**{key: value})
 
 
     with constant_refcount(key):
     with constant_refcount(key):
@@ -519,11 +519,11 @@ def test_map_property_contains():
 
 
 
 
 def test_map_property_get():
 def test_map_property_get():
-    key = 'key'
-    value = 'value'
+    key = 'key861801'
+    value = 'value861801'
     prop = map_property(**{key: value})
     prop = map_property(**{key: value})
 
 
-    default = 'default'
+    default = 'default861801'
     with constant_refcount(key):
     with constant_refcount(key):
         with constant_refcount(default):
         with constant_refcount(default):
             assert prop.get(key) == value
             assert prop.get(key) == value