Skip to content

Commit

Permalink
replace pytest-ordering with pytest-order
Browse files Browse the repository at this point in the history
  • Loading branch information
bnavigator committed Mar 28, 2021
1 parent 65d229a commit 1532721
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 74 deletions.
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies:
- pytest-cov
- pytest-lazy-fixture
- pytest-mock
- pytest-ordering
- pytest-order
- pytest-qt
- pytest-xvfb
- pyyaml
Expand Down
3 changes: 0 additions & 3 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ markers =
change_directory
use_startup_wdir: Test startup workingdir CONF
preload_project: Preload a project on the main window
first
second
third
no_xvfb
external_interpreter
test_environment_interpreter
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pytest <6.0
pytest-cov
pytest-lazy-fixture
pytest-mock
pytest-ordering
pytest-order
pytest-qt
pyyaml
scipy
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def run(self):
'pytest-cov',
'pytest-lazy-fixture',
'pytest-mock',
'pytest-ordering',
'pytest-order',
'pytest-qt',
'pyyaml',
'scipy',
Expand Down
2 changes: 1 addition & 1 deletion spyder/app/tests/test_cli_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from spyder.app import cli_options


@pytest.mark.first
@pytest.mark.order(1)
def test_get_options():
getopt = cli_options.get_options

Expand Down
8 changes: 4 additions & 4 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def remove_test_dir():
# ---- Tests
# =============================================================================
@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.single_instance
@pytest.mark.skipif(os.environ.get('CI', None) is None,
reason="It's not meant to be run outside of CIs")
Expand Down Expand Up @@ -387,7 +387,7 @@ def test_lock_action(main_window):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.skipif(os.name == 'nt' and PY2, reason="Fails on win and py2")
def test_default_plugin_actions(main_window, qtbot):
"""Test the effect of dock, undock, close and toggle view actions."""
Expand Down Expand Up @@ -964,7 +964,7 @@ def test_connection_to_external_kernel(main_window, qtbot):
kc.stop_channels()


@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.slow
@flaky(max_runs=3)
@pytest.mark.skipif(os.name == 'nt', reason="It times out sometimes on Windows")
Expand Down Expand Up @@ -2615,7 +2615,7 @@ def test_preferences_shortcut_reset_regression(main_window, qtbot):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
def test_preferences_change_interpreter(qtbot, main_window):
"""Test that on main interpreter change signal is emitted."""
# Check original pyls configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.skip(reason="Fail on CIs and it's too heavy to run locally")
def test_kite_install(qtbot):
"""Test the correct execution of the installation process of kite."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def lsp_client_and_completion(request):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_didOpen(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion

Expand All @@ -60,7 +60,7 @@ def test_didOpen(lsp_client_and_completion, qtbot):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_get_signature(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion

Expand Down Expand Up @@ -99,7 +99,7 @@ def test_get_signature(lsp_client_and_completion, qtbot):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_get_completions(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion

Expand Down Expand Up @@ -139,7 +139,7 @@ def test_get_completions(lsp_client_and_completion, qtbot):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_go_to_definition(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion

Expand Down Expand Up @@ -179,7 +179,7 @@ def test_go_to_definition(lsp_client_and_completion, qtbot):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_local_signature(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion

Expand Down Expand Up @@ -224,7 +224,7 @@ def test(a, b):


@pytest.mark.slow
@pytest.mark.third
@pytest.mark.order(3)
def test_send_workspace_folders_change(lsp_client_and_completion, qtbot):
client, completion = lsp_client_and_completion
folder = '/tmp/'
Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/completion/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_provider_detection(completion_plugin_all):


@pytest.mark.slow
# @pytest.mark.third
# @pytest.mark.order(3)
def test_plugin_completion_gather(qtbot_module, completion_receiver):
completion, receiver = completion_receiver

Expand Down Expand Up @@ -215,7 +215,7 @@ def test_plugin_completion_gather(qtbot_module, completion_receiver):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
def test_plugin_first_response_request(qtbot_module, completion_receiver):
completion, receiver = completion_receiver

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def nested_func():


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@flaky(max_runs=5)
def test_class_func_selector(completions_codeeditor, qtbot):
code_editor, _ = completions_codeeditor
Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/editor/widgets/tests/test_completions_hide.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@flaky(max_runs=5)
def test_automatic_completions_hide_complete(completions_codeeditor, qtbot):
"""Test on-the-fly completion closing when already complete.
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_automatic_completions_hide_complete(completions_codeeditor, qtbot):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@flaky(max_runs=5)
def test_automatic_completions_widget_visible(completions_codeeditor, qtbot):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def test_toggle_on_show_all_files(editorstack, outlineexplorer, test_files):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
def test_editor_outlineexplorer(qtbot, completions_codeeditor_outline):
"""Tests that the outline explorer reacts to editor changes."""
code_editor, outlineexplorer = completions_codeeditor_outline
Expand Down Expand Up @@ -403,7 +403,7 @@ def test_editor_outlineexplorer(qtbot, completions_codeeditor_outline):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
def test_empty_file(qtbot, completions_codeeditor_outline):
"""
Test that the outline explorer is updated correctly when
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/editor/widgets/tests/test_editorsplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def test_set_layout_settings_goto(editor_splitter_layout_bot):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.skipif(os.name == 'nt',
reason="Makes other tests fail on Windows")
def test_lsp_splitter_close(editor_splitter_lsp):
Expand Down
6 changes: 3 additions & 3 deletions spyder/plugins/editor/widgets/tests/test_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def myfunc2():


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@flaky(max_runs=5)
def test_folding(completions_codeeditor, qtbot):
code_editor, _ = completions_codeeditor
Expand All @@ -81,7 +81,7 @@ def test_folding(completions_codeeditor, qtbot):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@flaky(max_runs=5)
@pytest.mark.skipif(os.name == 'nt', reason="Hangs on Windows")
def test_unfold_when_searching(search_codeeditor, qtbot):
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_unfold_when_searching(search_codeeditor, qtbot):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@flaky(max_runs=5)
@pytest.mark.skipif(os.name == 'nt', reason="Hangs on Windows")
def test_unfold_goto(search_codeeditor, qtbot):
Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/editor/widgets/tests/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_formatter_values(formatter, range_fmt=False):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.parametrize('formatter', ['autopep8', 'yapf', 'black'])
def test_document_formatting(formatter, completions_codeeditor, qtbot):
"""Validate text autoformatting via autopep8, yapf or black."""
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_document_formatting(formatter, completions_codeeditor, qtbot):


@pytest.mark.slow
@pytest.mark.first
@pytest.mark.order(1)
@pytest.mark.parametrize('formatter', ['autopep8', 'yapf', 'black'])
def test_document_range_formatting(formatter, completions_codeeditor, qtbot):
"""Validate text range autoformatting."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def {SIG}:


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@pytest.mark.skipif(sys.platform == 'darwin' and PY2,
reason='Fails on Mac and Python 2')
def test_hide_calltip(completions_codeeditor, qtbot):
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_hide_calltip(completions_codeeditor, qtbot):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@pytest.mark.skipif(
os.name == 'nt' and PY2,
reason='Fails on Win',
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_get_calltips(qtbot, completions_codeeditor, params):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@pytest.mark.skipif(sys.platform == 'darwin', reason='Fails on Mac')
@pytest.mark.parametrize('params', [
# Parameter, Expected Output
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_get_hints(qtbot, completions_codeeditor, params, capsys):


@pytest.mark.slow
@pytest.mark.second
@pytest.mark.order(2)
@pytest.mark.skipif(sys.platform == 'darwin', reason='Fails on Mac')
def test_get_hints_not_triggered(qtbot, completions_codeeditor):
"""Test that the editor is not returning hover hints for empty docs."""
Expand Down
Loading

0 comments on commit 1532721

Please sign in to comment.