Commit bce9d6fa authored by Tres Seaver's avatar Tres Seaver

Avoid trying to delete items from empty dict / tree.

Monte Carlo tests suck for reproducibility.
parent 2720b204
......@@ -270,7 +270,7 @@ class BugFixes(unittest.TestCase):
LP294788_ids = {}
ids = {}
for i in xrange(1024):
if trandom.random() > 0.1:
if trandom.random() > 0.1 or len(ids) == 0:
#add
id = None
while id is None or id in ids:
......@@ -305,7 +305,7 @@ class BugFixes(unittest.TestCase):
LP294788_ids = {}
ids = {}
for i in xrange(1024):
if trandom.random() > 0.1:
if trandom.random() > 0.1 or len(ids) == 0:
#add
id = None
while id is None or id in ids:
......@@ -342,7 +342,7 @@ class BugFixes(unittest.TestCase):
LP294788_ids = {}
ids = {}
for i in xrange(1024):
if trandom.random() > 0.1:
if trandom.random() > 0.1 or len(ids) == 0:
#add
id = None
while id is None or id in ids:
......@@ -376,7 +376,7 @@ class BugFixes(unittest.TestCase):
LP294788_ids = {}
ids = {}
for i in xrange(1024):
if trandom.random() > 0.1:
if trandom.random() > 0.1 or len(ids) == 0:
#add
id = None
while id is None or id in ids:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment