diff --git a/tests/conftest.py b/tests/conftest.py index a915100a5e0..01d26676f39 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -74,6 +74,7 @@ 'tests.common.plugins.custom_fixtures', 'tests.common.dualtor', 'tests.decap', + 'tests.platform_tests.api', 'tests.common.plugins.allure_server', 'tests.common.plugins.conditional_mark') diff --git a/tests/platform_tests/api/__init__.py b/tests/platform_tests/api/__init__.py new file mode 100644 index 00000000000..0f7fd8546da --- /dev/null +++ b/tests/platform_tests/api/__init__.py @@ -0,0 +1,2 @@ +def pytest_addoption(parser): + parser.addoption("--unresettable_xcvr_types", action="append", default=[], help="unsupported resettable xcvr types") diff --git a/tests/platform_tests/api/conftest.py b/tests/platform_tests/api/conftest.py index 87bd310ef38..79706802b4e 100644 --- a/tests/platform_tests/api/conftest.py +++ b/tests/platform_tests/api/conftest.py @@ -107,7 +107,3 @@ def check_not_implemented_warnings(duthosts, enum_rand_one_per_hwsku_hostname): yield loganalyzer.match_regex.extend(['WARNING pmon#platform_api_server.py: API.+not implemented']) loganalyzer.analyze(marker) - - -def pytest_addoption(parser): - parser.addoption("--unresettable_xcvr_types", action="append", default=[], help="unsupported resettable xcvr types") diff --git a/tests/platform_tests/api/test_chassis.py b/tests/platform_tests/api/test_chassis.py index a92d1e5ba45..38c57d4b64e 100644 --- a/tests/platform_tests/api/test_chassis.py +++ b/tests/platform_tests/api/test_chassis.py @@ -12,7 +12,7 @@ from tests.common.utilities import skip_release from tests.common.platform.interface_utils import get_physical_port_indices from tests.platform_tests.cli.util import get_skip_mod_list -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_chassis_fans.py b/tests/platform_tests/api/test_chassis_fans.py index 27a38392495..74a0466eaaf 100644 --- a/tests/platform_tests/api/test_chassis_fans.py +++ b/tests/platform_tests/api/test_chassis_fans.py @@ -4,7 +4,7 @@ import pytest from tests.common.helpers.platform_api import chassis, fan -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase from tests.platform_tests.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon ################################################### diff --git a/tests/platform_tests/api/test_component.py b/tests/platform_tests/api/test_component.py index b0500c33024..4411699d868 100644 --- a/tests/platform_tests/api/test_component.py +++ b/tests/platform_tests/api/test_component.py @@ -3,7 +3,7 @@ from tests.common.helpers.assertions import pytest_assert from tests.common.helpers.platform_api import chassis, component -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase from tests.common.utilities import skip_release_for_platform ################################################### diff --git a/tests/platform_tests/api/test_fan_drawer.py b/tests/platform_tests/api/test_fan_drawer.py index 01429848968..3456e93f32e 100644 --- a/tests/platform_tests/api/test_fan_drawer.py +++ b/tests/platform_tests/api/test_fan_drawer.py @@ -4,7 +4,7 @@ from tests.common.helpers.platform_api import chassis, fan_drawer -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_fan_drawer_fans.py b/tests/platform_tests/api/test_fan_drawer_fans.py index 311fd1eaae3..5bd6254bfe0 100644 --- a/tests/platform_tests/api/test_fan_drawer_fans.py +++ b/tests/platform_tests/api/test_fan_drawer_fans.py @@ -6,7 +6,7 @@ from tests.common.helpers.platform_api import chassis, fan_drawer, fan_drawer_fan from tests.platform_tests.thermal_control_test_helper import start_thermal_control_daemon, stop_thermal_control_daemon -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_module.py b/tests/platform_tests/api/test_module.py index 5cd451ce080..6481a804a56 100644 --- a/tests/platform_tests/api/test_module.py +++ b/tests/platform_tests/api/test_module.py @@ -5,7 +5,7 @@ from time import sleep from tests.common.helpers.platform_api import chassis, module from tests.platform_tests.cli.util import get_skip_mod_list -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase from tests.common.helpers.assertions import pytest_assert from tests.common.helpers.dut_utils import ignore_t2_syslog_msgs diff --git a/tests/platform_tests/api/test_psu.py b/tests/platform_tests/api/test_psu.py index 23ac67b1517..7492186a61d 100644 --- a/tests/platform_tests/api/test_psu.py +++ b/tests/platform_tests/api/test_psu.py @@ -5,7 +5,7 @@ from tests.common.helpers.platform_api import chassis, psu from tests.common.utilities import skip_release from tests.platform_tests.cli.util import get_skip_mod_list -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase from tests.common.utilities import skip_release_for_platform diff --git a/tests/platform_tests/api/test_psu_fans.py b/tests/platform_tests/api/test_psu_fans.py index f6728d357b3..d844dd9c250 100644 --- a/tests/platform_tests/api/test_psu_fans.py +++ b/tests/platform_tests/api/test_psu_fans.py @@ -6,7 +6,7 @@ from tests.common.helpers.platform_api import chassis, psu, psu_fan -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_sfp.py b/tests/platform_tests/api/test_sfp.py index 76035da384f..8049a97bff4 100644 --- a/tests/platform_tests/api/test_sfp.py +++ b/tests/platform_tests/api/test_sfp.py @@ -12,7 +12,7 @@ from tests.common.fixtures.duthost_utils import shutdown_ebgp # noqa F401 from tests.common.mellanox_data import is_mellanox_device -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_thermal.py b/tests/platform_tests/api/test_thermal.py index e1e5d0c0c2c..00c811a36e9 100644 --- a/tests/platform_tests/api/test_thermal.py +++ b/tests/platform_tests/api/test_thermal.py @@ -4,7 +4,7 @@ from tests.common.helpers.platform_api import chassis, thermal from tests.common.utilities import skip_release_for_platform -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase ################################################### # TODO: Remove this after we transition to Python 3 diff --git a/tests/platform_tests/api/test_watchdog.py b/tests/platform_tests/api/test_watchdog.py index 2ceb3d1d541..0fa7a4a24fc 100644 --- a/tests/platform_tests/api/test_watchdog.py +++ b/tests/platform_tests/api/test_watchdog.py @@ -6,7 +6,7 @@ import pytest from tests.common.helpers.platform_api import watchdog from tests.common.helpers.assertions import pytest_assert -from platform_api_test_base import PlatformApiTestBase +from .platform_api_test_base import PlatformApiTestBase from collections import OrderedDict