Skip to content

Commit

Permalink
sort by class name since types are not orderable in py3
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Nov 4, 2014
1 parent 237e4a7 commit 20281da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/zope/testrunner/runner.py
Expand Up @@ -884,9 +884,13 @@ def layer_from_name(layer_name):
def order_by_bases(layers):
"""Order the layers from least to most specific (bottom to top)
"""
layers = [layer for layer in layers]
getmro = inspect.getmro
layers.sort(key=lambda x: getmro(x)[::-1])

def layer_sortkey(layer):
return (c.__name__ for c in getmro(layer)[::-1])

layers = [layer for layer in layers]
layers.sort(key=layer_sortkey)
gathered = []
for layer in layers:
gather_layers(layer, gathered)
Expand Down

0 comments on commit 20281da

Please sign in to comment.