Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): need to restore sys.meta_path along with sys.path
In the restore_import_state contextmanager, when the pre-test import state is restored, sys.meta_path must be restored along with sys.path. In some cases, setuptools appends it's finders to sys.meta_path. Since restore_import_state might "unimport" setuptools after a test, it can get confused and append its finders again in a second test. This results in import_metadata.distributions() listing all distributions twice. This results, e.g., in the cryptic 'RuntimeError: Plugin "webpack-support" is already registered' test failure.
- Loading branch information