From c210ecb765bc60b2424df284d0c101dc0bfeaf4d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 12 Jun 2019 06:36:57 -0400 Subject: Dynamic contexts can be disabled with 'none' --- coverage/control.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'coverage') diff --git a/coverage/control.py b/coverage/control.py index 552f7bc2..4cd1adad 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -349,13 +349,14 @@ class Coverage(object): # it for the main process. self.config.parallel = True - if self.config.dynamic_context is None: + dycon = self.config.dynamic_context + if not dycon or dycon == "none": context_switchers = [] - elif self.config.dynamic_context == "test_function": + elif dycon == "test_function": context_switchers = [should_start_context_test_function] else: raise CoverageException( - "Don't understand dynamic_context setting: {!r}".format(self.config.dynamic_context) + "Don't understand dynamic_context setting: {!r}".format(dycon) ) context_switchers.extend( -- cgit v1.2.1