From b234303216837a526046dae1d304ab363161d3ce Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 1 Aug 2017 09:41:03 -0500 Subject: [PATCH 1/5] Testing: Only install qtpy and qtconsole from Github for pip Qt5 packages --- continuous_integration/travis/install.sh | 6 +----- continuous_integration/travis/test-qt5.sh | 11 ++++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/continuous_integration/travis/install.sh b/continuous_integration/travis/install.sh index 4cbf7f9fb66..34af9f8ecb8 100755 --- a/continuous_integration/travis/install.sh +++ b/continuous_integration/travis/install.sh @@ -8,7 +8,7 @@ if [ "$TRAVIS_PYTHON_VERSION" = "3.5" ] && [ "$USE_PYQT" = "pyqt5" ]; then else export CONDA_DEPENDENCIES_FLAGS="--quiet" export CONDA_DEPENDENCIES="rope pyflakes sphinx pygments pylint psutil nbconvert \ - qtawesome pickleshare pyzmq chardet mock nomkl pandas \ + qtawesome pickleshare qtpy pyzmq chardet mock nomkl pandas \ pytest pytest-cov numpydoc scipy cython pillow jedi pycodestyle" export PIP_DEPENDENCIES="coveralls pytest-qt pytest-timeout flaky" fi @@ -23,10 +23,6 @@ export PATH="$HOME/miniconda/bin:$PATH" source activate test -# Install qtpy from Github -pip install git+https://github.com/spyder-ide/qtpy.git - - # We test with pip packages in Python 3.5 and PyQt5 if [ "$TRAVIS_PYTHON_VERSION" = "3.5" ] && [ "$USE_PYQT" = "pyqt5" ]; then # Install qtconsole from Github diff --git a/continuous_integration/travis/test-qt5.sh b/continuous_integration/travis/test-qt5.sh index 5a228b5c88f..5637accaa94 100755 --- a/continuous_integration/travis/test-qt5.sh +++ b/continuous_integration/travis/test-qt5.sh @@ -3,17 +3,18 @@ export PATH="$HOME/miniconda/bin:$PATH" source activate test -pip uninstall -q -y pytest-xvfb - # We test with pip packages in Python 3.5 and PyQt5 if [ "$TRAVIS_PYTHON_VERSION" = "3.5" ] && [ "$USE_PYQT" = "pyqt5" ]; then + pip uninstall -q -y pytest-xvfb pip install -q pyqt5 -else - conda install -q qt=5.* pyqt=5.* qtconsole matplotlib # Install qtconsole from Github - conda remove -q -y qtconsole pip install git+https://github.com/jupyter/qtconsole.git + + # Install qtpy from Github + pip install git+https://github.com/spyder-ide/qtpy.git +else + conda install -q qt=5.* pyqt=5.* qtconsole matplotlib fi python runtests.py From 579093e1dbfe29e5e851b657f7189ea2e09f23e4 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 1 Aug 2017 09:49:20 -0500 Subject: [PATCH 2/5] Testing: Separate the installation of Qt from running our tests in Travis --- .travis.yml | 8 ++------ .../travis/{test-qt5.sh => install-qt.sh} | 6 +++--- continuous_integration/travis/runtests.sh | 6 ++++++ continuous_integration/travis/test-qt4.sh | 13 ------------- 4 files changed, 11 insertions(+), 22 deletions(-) rename continuous_integration/travis/{test-qt5.sh => install-qt.sh} (84%) create mode 100755 continuous_integration/travis/runtests.sh delete mode 100755 continuous_integration/travis/test-qt4.sh diff --git a/.travis.yml b/.travis.yml index 9facd6bb102..79048cb7b4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,14 +29,10 @@ before_install: install: - ./continuous_integration/travis/install.sh; + - ./continuous_integration/travis/install-qt.sh; script: - - | - if [ "$USE_PYQT" = "pyqt5" ]; then - ./continuous_integration/travis/test-qt5.sh || ./continuous_integration/travis/test-qt5.sh - else - ./continuous_integration/travis/test-qt4.sh || ./continuous_integration/travis/test-qt4.sh - fi + - ./continuous_integration/travis/runtests.sh || ./continuous_integration/travis/runtests.sh || ./continuous_integration/travis/runtests.sh; after_success: - export PATH="$HOME/miniconda/bin:$PATH" && source activate test && coveralls diff --git a/continuous_integration/travis/test-qt5.sh b/continuous_integration/travis/install-qt.sh similarity index 84% rename from continuous_integration/travis/test-qt5.sh rename to continuous_integration/travis/install-qt.sh index 5637accaa94..d4757fb40f2 100755 --- a/continuous_integration/travis/test-qt5.sh +++ b/continuous_integration/travis/install-qt.sh @@ -13,8 +13,8 @@ if [ "$TRAVIS_PYTHON_VERSION" = "3.5" ] && [ "$USE_PYQT" = "pyqt5" ]; then # Install qtpy from Github pip install git+https://github.com/spyder-ide/qtpy.git -else +elif [ "$USE_PYQT" = "pyqt5" ]; then conda install -q qt=5.* pyqt=5.* qtconsole matplotlib +else + conda install -q qt=4.* pyqt=4.* qtconsole matplotlib fi - -python runtests.py diff --git a/continuous_integration/travis/runtests.sh b/continuous_integration/travis/runtests.sh new file mode 100755 index 00000000000..adf629ea0fd --- /dev/null +++ b/continuous_integration/travis/runtests.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export PATH="$HOME/miniconda/bin:$PATH" +source activate test + +python runtests.py diff --git a/continuous_integration/travis/test-qt4.sh b/continuous_integration/travis/test-qt4.sh deleted file mode 100755 index 9f605e958f4..00000000000 --- a/continuous_integration/travis/test-qt4.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -export PATH="$HOME/miniconda/bin:$PATH" -source activate test - -pip uninstall -q -y pytest-xvfb -conda install -q qt=4.* pyqt=4.* qtconsole matplotlib - -# Install qtconsole from Github -conda remove -q -y qtconsole -pip install git+https://github.com/jupyter/qtconsole.git - -python runtests.py From 2e55be5f59b2a9c775ef60f49f3197f10b0ae0c9 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 1 Aug 2017 10:29:06 -0500 Subject: [PATCH 3/5] Testing: Try to make test_runconfig_workdir to work when re-run it. --- spyder/app/tests/test_mainwindow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index 6c4f2ae9d76..a0d72ed071e 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -168,6 +168,8 @@ def test_calltip(main_window, qtbot): @flaky(max_runs=3) def test_runconfig_workdir(main_window, qtbot, tmpdir): """Test runconfig workdir options.""" + CONF.set('run', 'configurations', []) + # ---- Load test file ---- test_file = osp.join(LOCATION, 'script.py') main_window.editor.load(test_file) From 3bbefafb7a3dd7145167592f4d23d075013d8bfa Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 1 Aug 2017 10:40:03 -0500 Subject: [PATCH 4/5] IPython console: Don't try to read stderr file if it can't be found --- spyder/widgets/ipythonconsole/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyder/widgets/ipythonconsole/client.py b/spyder/widgets/ipythonconsole/client.py index 1e231c25780..9975e27df4a 100644 --- a/spyder/widgets/ipythonconsole/client.py +++ b/spyder/widgets/ipythonconsole/client.py @@ -436,7 +436,7 @@ def kernel_restarted_message(self, msg): stderr = self._read_stderr() except: stderr = None - except OSError: + except (OSError, IOError): stderr = None if stderr: From 66236be918cd5c888c7747d71e7b9afe0cd171ca Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 1 Aug 2017 11:02:23 -0500 Subject: [PATCH 5/5] Testing: Wait for file evaluation in test_runconfig_workdir [ci skip] --- spyder/app/tests/test_mainwindow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index a0d72ed071e..9bd620ce6e8 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -186,6 +186,7 @@ def test_runconfig_workdir(main_window, qtbot, tmpdir): shell = main_window.ipyconsole.get_current_shellwidget() qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT) qtbot.keyClick(code_editor, Qt.Key_F5) + qtbot.wait(500) # --- Assert we're in cwd after execution --- with qtbot.waitSignal(shell.executed): @@ -205,6 +206,7 @@ def test_runconfig_workdir(main_window, qtbot, tmpdir): shell = main_window.ipyconsole.get_current_shellwidget() qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT) qtbot.keyClick(code_editor, Qt.Key_F5) + qtbot.wait(500) # --- Assert we're in fixed dir after execution --- with qtbot.waitSignal(shell.executed):