From ffbc515ee93b24012a86d472841e987ae3959439 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Mon, 31 Dec 2018 11:36:07 +0000 Subject: [PATCH] TST: Fixing bug in skipping db tests by default --- pandas/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 851a779db2159..ddf96abdd3e73 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -61,8 +61,10 @@ def pytest_runtest_setup(item): "skipping high memory test since --run-high-memory was not set") # if "db" not explicitly set in the -m pattern, we skip the db tests - if 'db' in item.keywords: - pattern = item.config.getoption('-m') + pattern = item.config.getoption('-m') + if 'db' in item.keywords and not pattern: + pytest.skip('skipping db unless -m "db" is specified') + elif 'db' in item.keywords and pattern: markers = collections.defaultdict(bool) for marker in item.iter_markers(): markers[marker.name] = True