Skip to content

Conversation

@oboehmer
Copy link
Collaborator

Add find_pyats_common_parent() function to automatically locate and include pyats_common directories in the test PYTHONPATH. This enables test files to import shared utilities from pyats_common modules.

This way we can use a simpler import path in the architecture-specific python tests:

- from templates.apic.test.pyats_common.apic_base_test import APICTestBase
+ from pyats_common.apic_base_test import APICTestBase

Add find_pyats_common_parent() function to automatically locate and
include pyats_common directories in the test PYTHONPATH. This enables
test files to import shared utilities from pyats_common modules.
@oboehmer oboehmer requested a review from aitestino December 15, 2025 12:24
@aitestino
Copy link
Collaborator

Superseded by the creation of the nac-test-pyats-common external package, which provides a superior solution to the import path problem.

Resolution:
Instead of auto-discovering local pyats_common directories, we created a centralized pip package that all architecture repos import from:

Architecture repos now use standard imports:

from nac_test_pyats_common.aci import APICTestBase
from nac_test_pyats_common.sdwan import SDWANManagerTestBase
from nac_test_pyats_common.catalyst_center import CatalystCenterTestBase

Related:

@aitestino aitestino closed this Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants