From 041d828b9c9b0035581d37205c514f2630cc6fc6 Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 25 Oct 2020 09:01:33 -0700 Subject: [PATCH] TST: check_comprehensiveness compat for --lf and -k --- pandas/tests/indexing/test_coercion.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pandas/tests/indexing/test_coercion.py b/pandas/tests/indexing/test_coercion.py index d37b5986b57c1..436b2aa838b08 100644 --- a/pandas/tests/indexing/test_coercion.py +++ b/pandas/tests/indexing/test_coercion.py @@ -29,11 +29,21 @@ def has_test(combo): klass in x.name and dtype in x.name and method in x.name for x in cls_funcs ) - for combo in combos: - if not has_test(combo): - raise AssertionError(f"test method is not defined: {cls.__name__}, {combo}") + opts = request.config.option + if opts.lf or opts.keyword: + # If we are running with "last-failed" or -k foo, we expect to only + # run a subset of tests. + yield - yield + else: + + for combo in combos: + if not has_test(combo): + raise AssertionError( + f"test method is not defined: {cls.__name__}, {combo}" + ) + + yield class CoercionBase: