-
-
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.
Add some unittests for Plugin Client.
- Loading branch information
Showing
2 changed files
with
43 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
"""Tests for plugin_client.py.""" | ||
|
||
# Test library imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.utils.introspection.plugin_client import PluginClient | ||
from spyder.utils.introspection.manager import PLUGINS | ||
|
||
|
||
@pytest.mark.parametrize("plugin_name", PLUGINS) | ||
def test_plugin_client(qtbot, plugin_name): | ||
"""Test creation of the diferent plugin clients.""" | ||
plugin = PluginClient(plugin_name=plugin_name) | ||
|
||
assert plugin | ||
|
||
|
||
@pytest.mark.parametrize("plugin_name", PLUGINS) | ||
def test_plugin_client_extra_path(qtbot, plugin_name): | ||
"""Test adding of extra path. | ||
Extra path is used for adding spyder_path to plugin clients. | ||
""" | ||
extra_path = '/some/dummy/path' | ||
|
||
plugin = PluginClient(plugin_name=plugin_name, extra_path=[extra_path]) | ||
plugin.run() | ||
python_path = plugin.process.processEnvironment().value('PYTHONPATH') | ||
assert extra_path in python_path.split(':') | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |