File tree 5 files changed +24
-15
lines changed
5 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -34,23 +34,23 @@ matrix:
34
34
include :
35
35
- dist : trusty
36
36
env :
37
- - JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="not slow and not network and not db "
37
+ - JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="not slow and not network"
38
38
39
39
- dist : trusty
40
40
env :
41
- - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow"
41
+ - JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow and db "
42
42
addons :
43
43
apt :
44
44
packages :
45
45
- python-gtk2
46
46
47
47
- dist : trusty
48
48
env :
49
- - JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="not slow and not network" LOCALE_OVERRIDE="zh_CN.UTF-8"
49
+ - 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"
50
50
51
51
- dist : trusty
52
52
env :
53
- - JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="not slow and not network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
53
+ - 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
54
54
55
55
# In allow_failures
56
56
- dist : trusty
Original file line number Diff line number Diff line change @@ -12,37 +12,37 @@ jobs:
12
12
py35_np_120 :
13
13
ENV_FILE : ci/deps/azure-macos-35.yaml
14
14
CONDA_PY : " 35"
15
- PATTERN : " not slow and not network and not db "
15
+ PATTERN : " not slow and not network"
16
16
17
17
${{ if eq(parameters.name, 'Linux') }} :
18
18
py27_np_120 :
19
19
ENV_FILE : ci/deps/azure-27-compat.yaml
20
20
CONDA_PY : " 27"
21
- PATTERN : " not slow and not network and not db "
21
+ PATTERN : " not slow and not network"
22
22
23
23
py27_locale_slow_old_np :
24
24
ENV_FILE : ci/deps/azure-27-locale.yaml
25
25
CONDA_PY : " 27"
26
- PATTERN : " slow and not db "
26
+ PATTERN : " slow"
27
27
LOCALE_OVERRIDE : " zh_CN.UTF-8"
28
28
EXTRA_APT : " language-pack-zh-hans"
29
29
30
30
py36_locale_slow :
31
31
ENV_FILE : ci/deps/azure-36-locale_slow.yaml
32
32
CONDA_PY : " 36"
33
- PATTERN : " not slow and not network and not db "
33
+ PATTERN : " not slow and not network"
34
34
LOCALE_OVERRIDE : " it_IT.UTF-8"
35
35
36
36
py37_locale :
37
37
ENV_FILE : ci/deps/azure-37-locale.yaml
38
38
CONDA_PY : " 37"
39
- PATTERN : " not slow and not network and not db "
39
+ PATTERN : " not slow and not network"
40
40
LOCALE_OVERRIDE : " zh_CN.UTF-8"
41
41
42
42
py37_np_dev :
43
43
ENV_FILE : ci/deps/azure-37-numpydev.yaml
44
44
CONDA_PY : " 37"
45
- PATTERN : " not slow and not network and not db "
45
+ PATTERN : " not slow and not network"
46
46
TEST_ARGS : " -W error"
47
47
PANDAS_TESTING_MODE : " deprecate"
48
48
EXTRA_APT : " xsel"
Original file line number Diff line number Diff line change 38
38
displayName: 'Build'
39
39
- script : |
40
40
call activate pandas-dev
41
- pytest -m "not slow and not network and not db " --junitxml=test-data.xml pandas -n 2 -r sxX --strict --durations=10 %*
41
+ pytest -m "not slow and not network" --junitxml=test-data.xml pandas -n 2 -r sxX --strict --durations=10 %*
42
42
displayName: 'Test'
43
43
- task : PublishTestResults@2
44
44
inputs :
Original file line number Diff line number Diff line change
1
+ import collections
1
2
from datetime import date , time , timedelta
2
3
from decimal import Decimal
3
4
import importlib
@@ -54,14 +55,22 @@ def pytest_runtest_setup(item):
54
55
if 'network' in item .keywords and item .config .getoption ("--skip-network" ):
55
56
pytest .skip ("skipping due to --skip-network" )
56
57
57
- if 'db' in item .keywords and item .config .getoption ("--skip-db" ):
58
- pytest .skip ("skipping due to --skip-db" )
59
-
60
58
if 'high_memory' in item .keywords and not item .config .getoption (
61
59
"--run-high-memory" ):
62
60
pytest .skip (
63
61
"skipping high memory test since --run-high-memory was not set" )
64
62
63
+ # if "db" not explicitly set in the -m pattern, we skip the db tests
64
+ if 'db' in item .keywords :
65
+ pattern = item .config .getoption ('-m' )
66
+ markers = collections .defaultdict (bool )
67
+ for marker in item .iter_markers ():
68
+ markers [marker .name ] = True
69
+ markers ['db' ] = False
70
+ db_in_pattern = not eval (pattern , {}, markers )
71
+ if not db_in_pattern :
72
+ pytest .skip ('skipping db unless -m "db" is specified' )
73
+
65
74
66
75
# Configurations for all tests and all test modules
67
76
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def test(extra_args=None):
16
16
import hypothesis # noqa
17
17
except ImportError :
18
18
raise ImportError ("Need hypothesis>=3.58 to run tests" )
19
- cmd = ['--skip-slow' , '--skip-network' , '--skip-db' ]
19
+ cmd = ['--skip-slow' , '--skip-network' ]
20
20
if extra_args :
21
21
if not isinstance (extra_args , list ):
22
22
extra_args = [extra_args ]
You can’t perform that action at this time.
0 commit comments