-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test system PYTHONPATH import in test_pathmanager instead of test_mainwindow * Move restore_user_env fixture from app/tests/conftest.py to utils/tests/conftest.py * Ensure that the user environment script runs on posix while testing
- Loading branch information
Showing
6 changed files
with
103 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
# Standard library imports | ||
import os | ||
|
||
# Third-party imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.config.base import running_in_ci | ||
from spyder.utils.environ import ( | ||
get_user_env, set_user_env, amend_user_shell_init | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def restore_user_env(): | ||
"""Set user environment variables and restore upon test exit""" | ||
if not running_in_ci(): | ||
pytest.skip("Skipped because not in CI.") | ||
|
||
if os.name == "nt": | ||
orig_env = get_user_env() | ||
|
||
yield | ||
|
||
if os.name == "nt": | ||
set_user_env(orig_env) | ||
else: | ||
amend_user_shell_init(restore=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters