Registry / testing / pyats-aetest

pyats-aetest

JSON →
library26.5pypypiunverified

pyATS AEtest (version 26.3) is the primary test automation engine within the Cisco pyATS framework, designed for structured and hierarchical test script development, particularly for network device testing. It provides robust features such as common setup/cleanup stages, testcase parametrization, and comprehensive result reporting. The library typically follows a monthly or bi-monthly release cadence, aligning with broader pyATS framework updates.

pip install pyats.aetest
INSTALL
IMPORT
SIG · PYATS-AETEST
P
pyats-aetest
testingpythonv26.5
Install
9.6s avg
Import
—
Disk
151MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v26.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 10.85s
py 3.11
✕ build_error
✓ 9.2s
py 3.12
✕ build_error
✓ 7.28s
py 3.13
✕ build_error
✓ 7.55s
py 3.9
✓ —
✓ 13.3s
151MB installed
● package 151MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Aetest
✓ from pyats.aetest import Aetest
✗ import pyats.aetest
Testcase
✓ from pyats.aetest import Testcase
✗ import pyats.aetest
setup
✓ from pyats.aetest import setup
✗ import pyats.aetest

This quickstart demonstrates the basic structure of a pyATS AEtest script, including `CommonSetup`, `Testcase`, and `CommonCleanup` sections. It defines a simple testcase that uses data set up in the CommonSetup. The `aetest.main()` call allows the script to be executed directly.

from pyats import aetest class CommonSetup(aetest.CommonSetup): """Common Setup for all testcases""" @aetest.subsection def initial_setup(self): self.parent.parameters['my_data'] = 'initialized_data' self.passed('Common Setup completed') class TestcaseOne(aetest.Testcase): """A simple testcase""" @aetest.test def check_data(self): data = self.parent.parameters.get('my_data') if data == 'initialized_data': self.passed(f'Data matched: {data}') else: self.failed(f'Unexpected data: {data}') class CommonCleanup(aetest.CommonCleanup): """Common Cleanup for all testcases""" @aetest.subsection def final_cleanup(self): self.passed('Common Cleanup completed') if __name__ == '__main__': # To run this script: # 1. Save it as e.g., my_test.py # 2. Execute: python my_test.py # For advanced features like testbed parsing, use 'pyats run testbed my_test.py' aetest.main()
Debug
Known issues
breakingpyATS AEtest officially supports Python 3.8 and newer. Attempting to use older Python versions (e.g., Python 2.7 or Python 3.7) will lead to compatibility issues and `SyntaxError` or `ImportError` messages.
fix
Ensure your environment uses Python 3.8 or a later supported version. Upgrade Python if necessary or use a virtual environment with the correct Python version.
affects: < 24.x
gotchaThe PyPI package name `pyats-aetest` uses a hyphen, but the Python package name for importing is `pyats.aetest`. A common mistake is trying to `import pyats_aetest` or `import pyats-aetest`.
fix
Always use `from pyats import aetest` or `import pyats.aetest` in your code. Install with `pip install pyats.aetest`.
affects: All versions
gotchaRunning an AEtest script directly (e.g., `python my_test.py`) will execute the tests, but it will not automatically parse a testbed YAML file or provide advanced reporting features. This can lead to `AttributeError` if your script tries to access `self.runtime.testbed` or `self.parameters['testbed']`.
fix
For full functionality, including testbed parsing and rich reporting, always run your AEtest scripts using the `pyats run testbed` command: `pyats run testbed <script.py> --testbed-file <testbed.yaml>`.
affects: All versions
deprecatedOlder pyATS versions used `self.parent.parameters['testbed']` to access the testbed object. While this still works, the recommended and more robust way to access the testbed is via `self.runtime.testbed` when running with `pyats run testbed`.
fix
Prefer `self.runtime.testbed` for accessing the testbed object within your test sections, ensuring your script is executed via `pyats run testbed`.
affects: Pre-24.x (still functional but less robust)
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Amazon
1
Resources
pyats-aetest — pip install pyats-aetest · libregistry