Commit 14d9e84d authored by Armin Rigo's avatar Armin Rigo
Browse files

Fix for the failing test in test_typedef. The cause was ultimately

that the global _subclass_cache was populated with various 'config's,
and now there was too many of them for the test to pass.
parent ef06a997e7f1
......@@ -127,12 +127,15 @@ class TestTypeDef:
checks[2], checks[3]))
subclasses = {}
for key, subcls in typedef._subclass_cache.items():
if key[0] is not space.config:
cls = key[1]
subclasses.setdefault(cls, {})
subclasses[cls][subcls] = True
prevsubcls = subclasses[cls].setdefault(subcls.__name__, subcls)
assert subcls is prevsubcls
for cls, set in subclasses.items():
assert len(set) <= 6, "%s has %d subclasses:\n%r" % (
cls, len(set), [subcls.__name__ for subcls in set])
cls, len(set), list(set))
def test_getsetproperty(self):
class W_SomeType(Wrappable):
......@@ -103,6 +103,7 @@ def get_unique_interplevel_subclass(config, cls, hasdict, wants_slots,
except KeyError:
subcls = _getusercls(config, cls, hasdict, wants_slots, needsdel,
assert key not in _subclass_cache
_subclass_cache[key] = subcls
return subcls
get_unique_interplevel_subclass._annspecialcase_ = "specialize:memo"
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