You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
----conftest.py ---- s1_sheet_config, boot_config etc are lists.
def pytest_generate_tests(metafunc):
"""Dynamically parameterize tests based on loaded configurations."""
if 's1_sheet_idx' in metafunc.fixturenames:
metafunc.parametrize("s1_sheet_idx", [s1_sheet_config], indirect=True)
if 'bt_sheet_idx' in metafunc.fixturenames:
metafunc.parametrize("bt_sheet_idx", [boot_config], indirect=True)
if 'test_idx' in metafunc.fixturenames:
metafunc.parametrize("test_idx", [test_config], indirect=True)
if 'dt_idx' in metafunc.fixturenames:
metafunc.parametrize("dt_idx", [dt_config], indirect=True)
I want to execute the complete tests defined in the main.py file for one set of parametrized input first then the reload the new values for the next session and exectue the same tests again for the new set of loaded values.
Test Result should be:
test_boot_sanity [1-1-0] -- PASSED --> Test function for 0 index value
test_boot_sanity [1-1-1] -- PASSED --> Test function for 1 index value
test_boot_sanity [1-2-2] -- PASSED --> Test function for 2 index
:
test_dev_sanity [ 2-2-0] -- PASSED
test_dev_sanity [ 2-2-1] -- PASSED
test_dev_sanity [ 2-2-2] -- PASSED
However, seems only first case is executing... Any help is much appreciated.
The text was updated successfully, but these errors were encountered:
With indirect parameterization and objects pasded, pytest test reordering gets potentially confused in case it can't correctly establish parameter identity
There's ongoing tricky refactoring work to get this more stable
I just want to execute complete test cases with the parameterize input in one session. In next session the parameteize input will change for these test case and they will be executed.
Requirement is simple : Can we execute the test cases listed in a file which takes parametrize lists as input and need to run for different inputs like a new session.
Refering to this ticket : Session scoped fixture run multiple times when adding fixture via metafunc
#5738 : i am trying to achieve the following:
----conftest.py ----
s1_sheet_config, boot_config etc are lists.
def pytest_generate_tests(metafunc):
"""Dynamically parameterize tests based on loaded configurations."""
if 's1_sheet_idx' in metafunc.fixturenames:
metafunc.parametrize("s1_sheet_idx", [s1_sheet_config], indirect=True)
---- main.py----
@pytest.mark.parametrize("index", bt_sheet_idx)
def test_boot__sanity(self, index, obj_basic_config=TestBootConfig(), upd_count=TestIncrement(), test_reg=Register()):
......
@pytest.mark.parametrize("index", dt_idx)
def test_dev_sanity(self, index, obj_basic_config=TestBootConfig(), upd_count=TestIncrement(), test_reg=Register()):
.....
I want to execute the complete tests defined in the main.py file for one set of parametrized input first then the reload the new values for the next session and exectue the same tests again for the new set of loaded values.
Test Result should be:
test_boot_sanity [1-1-0] -- PASSED --> Test function for 0 index value
test_boot_sanity [1-1-1] -- PASSED --> Test function for 1 index value
test_boot_sanity [1-2-2] -- PASSED --> Test function for 2 index
:
test_dev_sanity [ 2-2-0] -- PASSED
test_dev_sanity [ 2-2-1] -- PASSED
test_dev_sanity [ 2-2-2] -- PASSED
However, seems only first case is executing... Any help is much appreciated.
The text was updated successfully, but these errors were encountered: