#### 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 |
||
---|---|---|
.. | ||
sonic_py_common | ||
tests | ||
.gitignore | ||
pytest.ini | ||
setup.cfg | ||
setup.py |