summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_mutants.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_mutants.py b/Lib/test/test_mutants.py
index 60a17aa..d495704 100644
--- a/Lib/test/test_mutants.py
+++ b/Lib/test/test_mutants.py
@@ -69,14 +69,12 @@ def maybe_mutate():
elif keys:
# Delete a key at random.
+ mutate = 0 # disable mutation until key deleted
i = random.randrange(len(keys))
key = keys[i]
del target[key]
- # CAUTION: don't use keys.remove(key) here. Or do <wink>. The
- # point is that .remove() would trigger more comparisons, and so
- # also more calls to this routine. We're mutating often enough
- # without that.
del keys[i]
+ mutate = 1
# A horrid class that triggers random mutations of dict1 and dict2 when
# instances are compared.