Skip to content

Commit

Permalink
* update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clary authored and mrclary committed May 11, 2021
1 parent 893627d commit 4cda2c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,7 @@ def test_preferences_change_interpreter(qtbot, main_window):
config = lsp.generate_python_config()
jedi = config['configurations']['pyls']['plugins']['jedi']
assert jedi['environment'] is None
assert jedi['extra_paths'] == []
assert jedi['extra_paths'] == os.environ.get('PYTHONPATH', '').split(os.pathsep)

# Change main interpreter on preferences
dlg, index, page = preferences_dialog_helper(qtbot, main_window,
Expand All @@ -2642,7 +2642,7 @@ def test_preferences_change_interpreter(qtbot, main_window):
config = lsp.generate_python_config()
jedi = config['configurations']['pyls']['plugins']['jedi']
assert jedi['environment'] == sys.executable
assert jedi['extra_paths'] == []
assert jedi['extra_paths'] == os.environ.get('PYTHONPATH', '').split(os.pathsep)


@pytest.mark.slow
Expand Down
11 changes: 7 additions & 4 deletions spyder/plugins/ipythonconsole/utils/kernelspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ def env(self):
repo_path = osp.normpath(osp.join(HERE, '..', '..', '..', '..'))
subrepo_path = osp.join(repo_path, 'external-deps',
'spyder-kernels')
pythonpath = env_vars.get('PYTHONPATH', '') if DEV else ''
env_vars.update(
{'PYTHONPATH': os.pathsep.join([subrepo_path, pythonpath])}
)
sys_pythonpath = env_vars.get('PYTHONPATH', '')
if DEV and sys_pythonpath:
# If DEV, don't clobber PYTHONPATH
pythonpath = os.pathsep.join([subrepo_path, sys_pythonpath])
else:
pythonpath = subrepo_path
env_vars.update({'PYTHONPATH': pythonpath})

# App considerations
if (running_in_mac_app() or is_pynsist()):
Expand Down

0 comments on commit 4cda2c3

Please sign in to comment.