Skip to content

Commit 6b1f3ac

Browse files
committed
Merge from 3.x: PR #6286
2 parents 59ee7ee + a7394fb commit 6b1f3ac

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

Diff for: .travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ matrix:
2626
before_install:
2727
- "export DISPLAY=:99.0"
2828
- "sh -e /etc/init.d/xvfb start"
29+
# Avoid annoying focus problems when running tests
30+
# See discussion in e.g. https://github.com/spyder-ide/spyder/pull/6132
31+
- sudo apt-get -qq update
32+
- sudo apt-get install -y matchbox-window-manager
2933

3034
install:
3135
- ./continuous_integration/travis/install.sh;
3236
- ./continuous_integration/travis/install-qt.sh;
37+
- DISPLAY=:99 matchbox-window-manager &
38+
- sleep 5
3339

3440
script:
3541
- ./continuous_integration/travis/runtests.sh || ./continuous_integration/travis/runtests.sh || ./continuous_integration/travis/runtests.sh;

Diff for: spyder/app/tests/test_mainwindow.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,14 @@ def close_window():
159159
#==============================================================================
160160
# IMPORTANT NOTE: Please leave this test to be the first one here to
161161
# avoid possible timeouts in Appveyor
162+
@pytest.mark.slow
162163
@pytest.mark.use_introspection
163164
@flaky(max_runs=3)
164-
@pytest.mark.skipif(os.environ.get('CI', None) is not None or os.name == 'nt' or PY2,
165-
reason="It times out in our CIs, and apparently Windows.")
166-
@pytest.mark.timeout(timeout=60, method='thread')
165+
@pytest.mark.skipif(os.name == 'nt',
166+
reason="It times out on Windows locally and on AppVeyor.")
167+
@pytest.mark.timeout(timeout=45, method='thread')
167168
def test_calltip(main_window, qtbot):
168-
"""Hide the calltip in the editor when a matching ')' is found."""
169+
"""Test that the calltip in editor is hidden when matching ')' is found."""
169170
# Load test file
170171
text = 'a = [1,2,3]\n(max'
171172
main_window.editor.new(fname="test.py", text=text)

Diff for: spyder/plugins/tests/test_ipythonconsole.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,12 @@ def test_read_stderr(ipyconsole, qtbot):
456456
assert content == client._read_stderr()
457457

458458

459+
@pytest.mark.slow
459460
@flaky(max_runs=10)
460461
@pytest.mark.no_xvfb
461-
@pytest.mark.skipif(os.environ.get('CI', None) is not None,
462-
reason="It times out in our CIs")
462+
@pytest.mark.skipif(os.environ.get('CI', None) is not None and os.name == 'nt',
463+
reason="It times out on AppVeyor.")
464+
@pytest.mark.timeout(timeout=20, method='thread')
463465
def test_values_dbg(ipyconsole, qtbot):
464466
"""
465467
Test that getting, setting, copying and removing values is working while

Diff for: spyder/widgets/tests/test_editor.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
# Standard library imports
12+
import os
1213
from sys import platform
1314
try:
1415
from unittest.mock import Mock, MagicMock
@@ -489,7 +490,7 @@ def test_get_current_word(base_editor_bot):
489490

490491

491492
def test_tab_keypress_properly_caught_find_replace(editor_find_replace_bot):
492-
"""Check that tab works in find/replace dialog. Regression test #3674.
493+
"""Test that tab works in find/replace dialog. Regression test for #3674.
493494
Mock test—more isolated but less flimsy."""
494495
editor_stack, editor, finder, qtbot = editor_find_replace_bot
495496
text = ' \nspam \nspam \nspam '
@@ -503,10 +504,11 @@ def test_tab_keypress_properly_caught_find_replace(editor_find_replace_bot):
503504

504505

505506
@flaky(max_runs=3)
506-
@pytest.mark.skipif(platform.startswith('linux'),
507-
reason="This test fails on Linux, for unknown reasons.")
507+
@pytest.mark.skipif(os.environ.get('CI', None) is None and
508+
platform.startswith('linux'),
509+
reason="Fails on some Linux platforms locally.")
508510
def test_tab_moves_focus_from_search_to_replace(editor_find_replace_bot):
509-
"""Check that tab works in find/replace dialog. Regression test #3674.
511+
"""Test that tab works in find/replace dialog. Regression test for #3674.
510512
"Real world" test—more comprehensive but potentially less robust."""
511513
editor_stack, editor, finder, qtbot = editor_find_replace_bot
512514
text = ' \nspam \nspam \nspam '

Diff for: spyder/widgets/variableexplorer/tests/test_dataframeeditor.py

+8-13
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def test_sort_dataframe_with_category_dtypes(qtbot): # cf. issue 5361
388388

389389

390390
def test_dataframemodel_set_data_overflow(monkeypatch):
391-
"""Unit test #6114: entry of an overflow int caught and handled properly"""
391+
"""Test for #6114: Overflowing ints are caught and handled properly"""
392392
MockQMessageBox = Mock()
393393
attr_to_patch = ('spyder.widgets.variableexplorer' +
394394
'.dataframeeditor.QMessageBox')
@@ -414,10 +414,11 @@ def test_dataframemodel_set_data_overflow(monkeypatch):
414414

415415

416416
@flaky(max_runs=3)
417-
@pytest.mark.skipif(platform.startswith('linux'),
418-
reason="Fails on some Linux platforms locally and Travis.")
417+
@pytest.mark.skipif(os.environ.get('CI', None) is None and
418+
platform.startswith('linux'),
419+
reason="Fails on some Linux platforms locally.")
419420
def test_dataframeeditor_edit_overflow(qtbot, monkeypatch):
420-
"""Test #6114: entry of an overflow int is caught and handled properly"""
421+
"""Test #6114: Entry of an overflow int is caught and handled properly"""
421422
MockQMessageBox = Mock()
422423
attr_to_patch = ('spyder.widgets.variableexplorer' +
423424
'.dataframeeditor.QMessageBox')
@@ -459,7 +460,7 @@ def test_dataframeeditor_edit_overflow(qtbot, monkeypatch):
459460

460461

461462
def test_dataframemodel_set_data_complex(monkeypatch):
462-
"""Unit test #6115: editing complex dtypes raises error in df editor"""
463+
"""Test for #6115: Editing complex dtypes raises error in df editor"""
463464
MockQMessageBox = Mock()
464465
attr_to_patch = ('spyder.widgets.variableexplorer' +
465466
'.dataframeeditor.QMessageBox')
@@ -479,9 +480,6 @@ def test_dataframemodel_set_data_complex(monkeypatch):
479480

480481

481482
@flaky(max_runs=3)
482-
@pytest.mark.skipif(os.environ.get('CI', None) is not None or
483-
platform.startswith('linux'),
484-
reason="Fails on Travis for no good reason.")
485483
def test_dataframeeditor_edit_complex(qtbot, monkeypatch):
486484
"""Test for #6115: editing complex dtypes raises error in df editor"""
487485
MockQMessageBox = Mock()
@@ -521,7 +519,7 @@ def test_dataframeeditor_edit_complex(qtbot, monkeypatch):
521519

522520

523521
def test_dataframemodel_set_data_bool(monkeypatch):
524-
"""Unit test that bools are editible in df and false-y strs are detected"""
522+
"""Test that bools are editible in df and false-y strs are detected"""
525523
MockQMessageBox = Mock()
526524
attr_to_patch = ('spyder.widgets.variableexplorer' +
527525
'.dataframeeditor.QMessageBox')
@@ -542,11 +540,8 @@ def test_dataframemodel_set_data_bool(monkeypatch):
542540

543541

544542
@flaky(max_runs=3)
545-
@pytest.mark.skipif(os.environ.get('CI', None) is not None or
546-
platform.startswith('linux'),
547-
reason="Fails on Travis for no good reason.")
548543
def test_dataframeeditor_edit_bool(qtbot, monkeypatch):
549-
"""Unit test that bools are editible in df and false-y strs are detected"""
544+
"""Test that bools are editible in df and false-y strs are detected"""
550545
MockQMessageBox = Mock()
551546
attr_to_patch = ('spyder.widgets.variableexplorer' +
552547
'.dataframeeditor.QMessageBox')

0 commit comments

Comments
 (0)