13
13
# limitations under the License.
14
14
15
15
import pytest
16
- from conftest import ES_SETTINGS , ES_URL , ES_VERSION
16
+ from conftest import ES_SETTINGS , ES_URL , ES_VERSION , RUN_IF_V7_OR_BELOW , RUN_IF_V8_OR_ABOVE
17
17
from testing_support .util import instance_hostname
18
18
from testing_support .validators .validate_transaction_errors import validate_transaction_errors
19
19
from testing_support .validators .validate_transaction_metrics import validate_transaction_metrics
33
33
34
34
NodeConfig = dict
35
35
36
-
37
- IS_V8 = ES_VERSION >= (8 ,)
38
- IS_V7 = ES_VERSION >= (7 ,) and ES_VERSION < (8 , 0 )
39
- IS_BELOW_V7 = ES_VERSION < (7 ,)
40
-
41
- RUN_IF_V8 = pytest .mark .skipif (IS_V7 or IS_BELOW_V7 , reason = "Only run for v8+" )
42
- RUN_IF_V7 = pytest .mark .skipif (IS_V8 or IS_BELOW_V7 , reason = "Only run for v7" )
43
- RUN_IF_BELOW_V7 = pytest .mark .skipif (not IS_BELOW_V7 , reason = "Only run for versions below v7" )
44
-
45
36
HOST = instance_hostname (ES_SETTINGS ["host" ])
46
37
PORT = ES_SETTINGS ["port" ]
47
38
@@ -59,14 +50,14 @@ def _exercise_es(es):
59
50
"client_kwargs" ,
60
51
[
61
52
pytest .param ({}, id = "DefaultTransport" ),
62
- pytest .param ({"connection_class" : Urllib3HttpConnection }, id = "Urllib3HttpConnectionv7" , marks = RUN_IF_BELOW_V7 ),
63
53
pytest .param (
64
- {"connection_class" : RequestsHttpConnection }, id = "RequestsHttpConnectionv7" , marks = RUN_IF_BELOW_V7
54
+ {"connection_class" : Urllib3HttpConnection }, id = "Urllib3HttpConnectionv7" , marks = RUN_IF_V7_OR_BELOW
55
+ ),
56
+ pytest .param (
57
+ {"connection_class" : RequestsHttpConnection }, id = "RequestsHttpConnectionv7" , marks = RUN_IF_V7_OR_BELOW
65
58
),
66
- pytest .param ({"connection_class" : Urllib3HttpConnection }, id = "Urllib3HttpConnectionv7" , marks = RUN_IF_V7 ),
67
- pytest .param ({"connection_class" : RequestsHttpConnection }, id = "RequestsHttpConnectionv7" , marks = RUN_IF_V7 ),
68
- pytest .param ({"node_class" : Urllib3HttpConnection }, id = "Urllib3HttpNodev8" , marks = RUN_IF_V8 ),
69
- pytest .param ({"node_class" : RequestsHttpConnection }, id = "RequestsHttpNodev8" , marks = RUN_IF_V8 ),
59
+ pytest .param ({"node_class" : Urllib3HttpConnection }, id = "Urllib3HttpNodev8" , marks = RUN_IF_V8_OR_ABOVE ),
60
+ pytest .param ({"node_class" : RequestsHttpConnection }, id = "RequestsHttpNodev8" , marks = RUN_IF_V8_OR_ABOVE ),
70
61
],
71
62
)
72
63
@validate_transaction_errors (errors = [])
0 commit comments