This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sonic-py-common
Joe LeVeque 9f114cab6c
[sonic-py-common] Clear environment variables before running device_info tests (#7273)
#### Why I did it

To ensure any environment variables which are configured in the build/test environment do not influence the behavior of sonic-py-common during unit tests. For example, variables which might be set by continuous integration pipelines.

#### How I did it

Add class-scoped pytest fixture to `TestDeviceInfo` class which stashes the current environment variables, clears them and yields. Once all the test cases in the class finish, the fixture will restore the original environment variables.

Also remove unnecessary unittest-style setup and teardown functions from interface_test.py
2021-06-28 09:30:53 -07:00
..
sonic_py_common [Marvell] Fix system MAC parsing logic for Marvell platform. (#7914) 2021-06-18 11:32:30 -07:00
tests [sonic-py-common] Clear environment variables before running device_info tests (#7273) 2021-06-28 09:30:53 -07:00
.gitignore [sonic-py-common] Add unit test framework (#5238) 2020-08-24 10:35:22 -07:00
pytest.ini [sonic-py-common] Add unit test framework (#5238) 2020-08-24 10:35:22 -07:00
setup.cfg [sonic-py-common] Add unit test framework (#5238) 2020-08-24 10:35:22 -07:00
setup.py [python-click] No longer build our own package, let pip/setuptools install vanilla (#5549) 2020-10-14 10:16:35 -07:00