From 6293848f6f8ab4f8caa342bc61fea0e2bd63258b Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 1 Jan 2019 12:13:45 -0500 Subject: [PATCH 1/4] CI: fix db usage in CI closes #24528 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f6a5f0c5d9aa..31fc0014536dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ matrix: - dist: trusty env: - - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow and db" + - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow or db" addons: apt: packages: @@ -46,11 +46,11 @@ matrix: - dist: trusty env: - - JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="not slow and not network and db" LOCALE_OVERRIDE="zh_CN.UTF-8" + - JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="(not slow and not network) or db" LOCALE_OVERRIDE="zh_CN.UTF-8" - dist: trusty env: - - JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="not slow and not network and db" PANDAS_TESTING_MODE="deprecate" COVERAGE=true + - JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="(not slow and not network) or db" PANDAS_TESTING_MODE="deprecate" COVERAGE=true # In allow_failures - dist: trusty From b30cfdb1e1108b805225c15e9d2d4bb524d41103 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 1 Jan 2019 12:41:40 -0500 Subject: [PATCH 2/4] moar --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 31fc0014536dc..e478d71a5c350 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,11 +34,11 @@ matrix: include: - dist: trusty env: - - JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="not slow and not network" + - JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)" - dist: trusty env: - - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow or db" + - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="(not slow or (single and db))" addons: apt: packages: @@ -46,11 +46,11 @@ matrix: - dist: trusty env: - - JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="(not slow and not network) or db" LOCALE_OVERRIDE="zh_CN.UTF-8" + - JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" - dist: trusty env: - - JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="(not slow and not network) or db" PANDAS_TESTING_MODE="deprecate" COVERAGE=true + - JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true # In allow_failures - dist: trusty From abbf10526c1164d6620ef980e11f8a7a844adf19 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 1 Jan 2019 13:18:41 -0500 Subject: [PATCH 3/4] revert --- pandas/conftest.py | 16 +++------------- pandas/util/_tester.py | 2 +- test_fast.bat | 2 +- test_fast.sh | 2 +- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index ddf96abdd3e73..d7c9dee64e65d 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -55,24 +55,14 @@ def pytest_runtest_setup(item): if 'network' in item.keywords and item.config.getoption("--skip-network"): pytest.skip("skipping due to --skip-network") + if 'db' in item.keywords and item.config.getoption("--skip-db"): + pytest.skip("skipping due to --skip-db") + if 'high_memory' in item.keywords and not item.config.getoption( "--run-high-memory"): pytest.skip( "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 - 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 - markers['db'] = False - db_in_pattern = not eval(pattern, {}, markers) - if not db_in_pattern: - pytest.skip('skipping db unless -m "db" is specified') - # Configurations for all tests and all test modules diff --git a/pandas/util/_tester.py b/pandas/util/_tester.py index aad2f00fa0478..18e8d415459fd 100644 --- a/pandas/util/_tester.py +++ b/pandas/util/_tester.py @@ -16,7 +16,7 @@ def test(extra_args=None): import hypothesis # noqa except ImportError: raise ImportError("Need hypothesis>=3.58 to run tests") - cmd = ['--skip-slow', '--skip-network'] + cmd = ['--skip-slow', '--skip-network', '--skip-db'] if extra_args: if not isinstance(extra_args, list): extra_args = [extra_args] diff --git a/test_fast.bat b/test_fast.bat index 81f30dd310e28..f2c4e9fa71fcd 100644 --- a/test_fast.bat +++ b/test_fast.bat @@ -1,3 +1,3 @@ :: test on windows set PYTHONHASHSEED=314159265 -pytest --skip-slow --skip-network -m "not single" -n 4 -r sXX --strict pandas +pytest --skip-slow --skip-network --skip-db -m "not single" -n 4 -r sXX --strict pandas diff --git a/test_fast.sh b/test_fast.sh index 1fb55e581d292..0a47f9de600ea 100755 --- a/test_fast.sh +++ b/test_fast.sh @@ -5,4 +5,4 @@ # https://github.com/pytest-dev/pytest/issues/1075 export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') -pytest pandas --skip-slow --skip-network -m "not single" -n 4 -r sxX --strict "$@" +pytest pandas --skip-slow --skip-network --skip-db -m "not single" -n 4 -r sxX --strict "$@" From 24e5d6b647e7616c26aac497ff4d052326661621 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Tue, 1 Jan 2019 19:33:59 +0000 Subject: [PATCH 4/4] Fix linting error: unused import --- pandas/conftest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index d7c9dee64e65d..f383fb32810e7 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -1,4 +1,3 @@ -import collections from datetime import date, time, timedelta from decimal import Decimal import importlib