Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/common/plugins/conditional_mark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

DEFAULT_CONDITIONS_FILE = 'common/plugins/conditional_mark/tests_mark_conditions*.yaml'
ASIC_NAME_PATH = '/../../../../ansible/group_vars/sonic/variables'
CONSTANTS_YAML_FILE = "common/plugins/conditional_mark/constants.yaml"


def pytest_addoption(parser):
Expand Down Expand Up @@ -170,12 +171,34 @@ def get_dut_name(session):
return dut_name


def update_declared_constants(out_basic_facts, filename=CONSTANTS_YAML_FILE):
'''
Find more facts (variable definitions) declared in the CONSTANTS_YAML_KEY yaml definition, if any.
Update the out_basic_facts dict in-place so that each new condition can potentially use the previous one.
'''
with open(filename) as f:
logger.debug('Loaded test constants file: {}'.format(filename))
constants = yaml.safe_load(f)
assert isinstance(constants, list), \
"Expected list in {} file of name/value records".format(CONSTANTS_YAML_FILE)
for name_val_dct in constants:
assert "name" in name_val_dct, "Test mark condition constant requires a 'name' field"
assert "value" in name_val_dct, "Test mark condition constant requires a 'value' field"
name = str(name_val_dct["name"])
value = str(name_val_dct["value"])
# Use 'locals' instead of 'globals' parameter for eval since the 'globals' parameter becomes
# side-effected with a __builtins__ field that corrupts the basic facts.
evaluated = eval(value, None, out_basic_facts)
out_basic_facts[name] = evaluated


def get_basic_facts(session):
dut_name = get_dut_name(session)
cached_facts_name = f'BASIC_FACTS_{dut_name}'
basic_facts_cached = session.config.cache.get(cached_facts_name, None)
if not basic_facts_cached:
basic_facts = load_basic_facts(dut_name, session)
update_declared_constants(basic_facts)
session.config.cache.set(cached_facts_name, basic_facts)


Expand Down
6 changes: 6 additions & 0 deletions tests/common/plugins/conditional_mark/constants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#######################################
##### constants #####
#######################################

- name: "skip_qos_sai_bad_topo"
value: "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
38 changes: 19 additions & 19 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ qos/test_qos_sai.py::TestQosSai:
conditions_logical_operator: or
conditions:
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testIPIPQosSaiDscpToPgMapping:
skip:
Expand All @@ -1840,7 +1840,7 @@ qos/test_qos_sai.py::TestQosSai::testIPIPQosSaiDscpToPgMapping:
- "asic_type in ['mellanox']"
- https://github.com/sonic-net/sonic-mgmt/issues/12906
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testPfcStormWithSharedHeadroomOccupancy:
skip:
Expand All @@ -1849,7 +1849,7 @@ qos/test_qos_sai.py::TestQosSai::testPfcStormWithSharedHeadroomOccupancy:
conditions:
- "asic_type in ['cisco-8000']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiBufferPoolWatermark:
skip:
Expand All @@ -1858,7 +1858,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiBufferPoolWatermark:
conditions:
- "platform in ['x86_64-nokia_ixr7250e_36x400g-r0', 'x86_64-arista_7800r3_48cq2_lc', 'x86_64-arista_7800r3_48cqm2_lc', 'x86_64-arista_7800r3a_36d2_lc', 'x86_64-arista_7800r3a_36dm2_lc','x86_64-arista_7800r3ak_36dm2_lc']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pPgMapping:
skip:
Expand All @@ -1867,7 +1867,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pPgMapping:
conditions:
- "'backend' not in topo_name"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pQueueMapping:
skip:
Expand All @@ -1876,7 +1876,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pQueueMapping:
conditions:
- "'backend' not in topo_name"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiDscpQueueMapping:
skip:
Expand All @@ -1885,7 +1885,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiDscpQueueMapping:
conditions:
- "'backend' in topo_name"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiDscpToPgMapping:
skip:
Expand All @@ -1894,7 +1894,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiDscpToPgMapping:
conditions:
- "'backend' in topo_name"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiDwrrWeightChange:
skip:
Expand All @@ -1903,7 +1903,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiDwrrWeightChange:
conditions:
- "asic_type in ['mellanox']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiFullMeshTrafficSanity:
skip:
Expand All @@ -1912,7 +1912,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiFullMeshTrafficSanity:
conditions:
- "asic_type not in ['cisco-8000'] or topo_name not in ['ptf64']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:
skip:
Expand All @@ -1923,7 +1923,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolSize:
and topo_type in ['t1-64-lag'] and hwsku not in ['Arista-7060CX-32S-C32', 'Celestica-DX010-C32', 'Arista-7260CX3-D108C8', 'Arista-7260CX3-D108C10', 'Force10-S6100', 'Arista-7260CX3-Q64', 'Arista-7050CX3-32S-C32', 'Arista-7050CX3-32S-D48C8', 'Arista-7060CX-32S-D48C8'] and asic_type not in ['mellanox']
and asic_type in ['cisco-8000']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"
- "'t2' in topo_name and asic_subtype in ['broadcom-dnx']"
- "asic_type in ['vs']"

Expand All @@ -1936,7 +1936,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiHeadroomPoolWatermark:
and asic_type in ['cisco-8000']
and https://github.com/sonic-net/sonic-mgmt/issues/12292 and hwsku in ['Force10-S6100'] and topo_type in ['t1-64-lag']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"
xfail:
reason: "Headroom pool size not supported."
conditions:
Expand All @@ -1949,7 +1949,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiLosslessVoq:
conditions:
- "asic_type not in ['cisco-8000'] or platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoq:
skip:
Expand All @@ -1958,7 +1958,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoq:
conditions:
- "asic_type not in ['cisco-8000'] or platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoqMultiSrc:
skip:
Expand All @@ -1967,7 +1967,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueueVoqMultiSrc:
conditions:
- "asic_type not in ['cisco-8000'] or platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
skip:
Expand All @@ -1976,7 +1976,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiPGDrop:
conditions:
- "asic_type not in ['cisco-8000'] or platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiPgHeadroomWatermark:
skip:
Expand All @@ -1985,7 +1985,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiPgHeadroomWatermark:
conditions:
- "asic_type in ['cisco-8000'] and not platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiPgSharedWatermark[None-wm_pg_shared_lossy]:
xfail:
Expand All @@ -2000,7 +2000,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiQWatermarkAllPorts:
conditions:
- "asic_type not in ['cisco-8000']"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiSharedReservationSize:
skip:
Expand All @@ -2009,7 +2009,7 @@ qos/test_qos_sai.py::TestQosSai::testQosSaiSharedReservationSize:
conditions:
- "asic_type not in ['cisco-8000'] or platform.startswith('x86_64-8122_')"
- "topo_type in ['m0', 'mx', 'm1', 'm2', 'm3']"
- "topo_name not in ['t0', 't0-64', 't0-116', 't0-118', 't0-35', 't0-56', 't0-standalone-32', 't0-standalone-64', 't0-standalone-128', 't0-standalone-256', 'dualtor-56', 'dualtor-120', 'dualtor', 't0-80', 't0-backend', 't1-lag', 't1-28-lag', 't1-64-lag', 't1-56-lag', 't1-backend', 't2', 't2_2lc_36p-masic', 't2_2lc_min_ports-masic'] and asic_type not in ['mellanox']"
- "skip_qos_sai_bad_topo"

qos/test_qos_sai.py::TestQosSai::testQosSaiXonHysteresis:
skip:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: "string"
value: "'some_value'"

- name: "is_some_value"
value: "string == 'some_value'"

- name: "is_vs"
value: "asic_type in ['vs']"
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,23 @@ test_conditional_mark.py::test_mark_9_2:
reason: "Xfail test_conditional_mark.py::test_mark_9_2"
conditions:
- "asic_type in ['vs']"

test_conditional_mark.py::test_constants_1:
skip:
reason: "Boolean logic"
conditions:
- "is_vs"

test_conditional_mark.py::test_constants_2:
xfail:
reason: "Constants can use other constant definitions"
conditions:
- "is_some_value"

test_conditional_mark.py::test_constants_3:
xfail:
reason: "Negative test"
conditions_logical_operator: or
conditions:
- "not is_some_value"
- "not is_vs"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import unittest
from unittest.mock import MagicMock
from tests.common.plugins.conditional_mark import find_all_matches, load_conditions
from tests.common.plugins.conditional_mark import find_all_matches, load_conditions, update_declared_constants

logger = logging.getLogger(__name__)

Expand All @@ -13,7 +13,9 @@ def load_test_conditions():
session_mock = MagicMock()
session_mock.config.option.mark_conditions_files = \
["tests/common/plugins/conditional_mark/unit_test/tests_conditions.yaml"]
return load_conditions(session_mock), session_mock
conditions = load_conditions(session_mock)
update_declared_constants(CUSTOM_BASIC_FACTS, "tests/common/plugins/conditional_mark/unit_test/constants.yaml")
return conditions, session_mock


class TestFindAllMatches(unittest.TestCase):
Expand Down Expand Up @@ -292,6 +294,47 @@ def test_only_use_the_longest_6(self):
self.assertEqual(len(marks_found), 1)
self.assertIn('xfail', marks_found)

def test_constants_boolean(self):
conditions, session_mock = load_test_conditions()
nodeid = "test_conditional_mark.py::test_constants_1"

marks_found = []
matches = find_all_matches(nodeid, conditions, session_mock, DYNAMIC_UPDATE_SKIP_REASON, CUSTOM_BASIC_FACTS)

for match in matches:
for mark_name, mark_details in list(list(match.values())[0].items()):
marks_found.append(mark_name)

self.assertEqual(len(marks_found), 1)
self.assertIn('skip', marks_found)

def test_constants_chain(self):
conditions, session_mock = load_test_conditions()
nodeid = "test_conditional_mark.py::test_constants_2"

marks_found = []
matches = find_all_matches(nodeid, conditions, session_mock, DYNAMIC_UPDATE_SKIP_REASON, CUSTOM_BASIC_FACTS)

for match in matches:
for mark_name, mark_details in list(list(match.values())[0].items()):
marks_found.append(mark_name)

self.assertEqual(len(marks_found), 1)
self.assertIn('xfail', marks_found)

def test_constants_negative(self):
conditions, session_mock = load_test_conditions()
nodeid = "test_conditional_mark.py::test_constants_3"

marks_found = []
matches = find_all_matches(nodeid, conditions, session_mock, DYNAMIC_UPDATE_SKIP_REASON, CUSTOM_BASIC_FACTS)

for match in matches:
for mark_name, mark_details in list(list(match.values())[0].items()):
marks_found.append(mark_name)

self.assertEqual(len(marks_found), 0)


if __name__ == "__main__":
unittest.main()
Loading