From 3c0087f4bba12d37c8c6ff17c8025dfb7f988494 Mon Sep 17 00:00:00 2001 From: jesse Date: Wed, 3 Feb 2021 21:41:45 -0800 Subject: [PATCH] Change Prune function's name to something hopefully a bit clearer --- src/cutest/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cutest/__init__.py b/src/cutest/__init__.py index dffb34e..1a0d762 100644 --- a/src/cutest/__init__.py +++ b/src/cutest/__init__.py @@ -141,13 +141,13 @@ def print_graph(self, stream_: ThreadSafeOutputStream, depth=0): for node in self.children: node.print_graph(stream_, depth=depth + 1) - def prune_all_but(self, nodes: Iterable['Node']) -> bool: + def prune_children_except(self, nodes: Iterable['Node']) -> bool: """ Prune children unless they are in nodes or ancestors of nodes. Return if this node should be saved """ - save_children = [c for c in self.children if c.prune_all_but(nodes)] + save_children = [c for c in self.children if c.prune_children_except(nodes)] self.children = save_children return self in nodes or any(save_children) @@ -375,7 +375,7 @@ def pruned_suites(self, tests: Set[Test]): assert None not in raw_suites for suite in raw_suites: suite.initialize() - if suite.prune_all_but(tests): + if suite.prune_children_except(tests): yield suite def run_suite(self, suite: Suite):