From 30a5bc3f6ed67be4fae236ef6710dc5422117fff Mon Sep 17 00:00:00 2001 From: jessebrennan Date: Sun, 10 May 2020 19:09:41 -0700 Subject: [PATCH] Fix linting and tests neglected from last commit --- src/cutest/__init__.py | 6 +----- test/test_runner.py | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cutest/__init__.py b/src/cutest/__init__.py index ea24a50..114bea7 100644 --- a/src/cutest/__init__.py +++ b/src/cutest/__init__.py @@ -63,11 +63,7 @@ def fixture(self, obj) -> 'FixtureDefinition': block. Any cleanup should happen inside of an attached finally block. """ - if ( - inspect.isclass(obj) - and hasattr(obj, '__enter__') - and hasattr(obj, '__exit__') - ): + if inspect.isclass(obj) and hasattr(obj, '__enter__') and hasattr(obj, '__exit__'): return FixtureDefinition(self, obj) elif inspect.isgeneratorfunction(obj): cm = contextmanager(obj) diff --git a/test/test_runner.py b/test/test_runner.py index 5ee4501..b396b2e 100644 --- a/test/test_runner.py +++ b/test/test_runner.py @@ -7,7 +7,8 @@ class RunnerTest(unittest.TestCase): def test_prune(self): - runner = cutest.SerialRunner() + test_output = cutest.default_output_stream() + runner = cutest.SerialRunner(test_output, verbosity=1) sample.my_suite.initialize() pruned = list(runner.pruned_suites(sample.test_1.calls)) self.assertEqual(len(pruned), 1)