Skip to content

Commit

Permalink
Tests: Use backported mock library on Python2
Browse files Browse the repository at this point in the history
  • Loading branch information
jitseniesen committed Jul 26, 2016
1 parent d03e2f8 commit 136112a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion continuous_integration/appveyor/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function UpdateConda ($python_home) {
function main () {
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
UpdateConda $env:PYTHON
InstallCondaPackages $env:PYTHON "conda-build==1.21.0 pytest pytest-cov pytest-qt"
InstallCondaPackages $env:PYTHON "conda-build==1.21.0 pytest pytest-cov pytest-qt mock"
}


Expand Down
4 changes: 2 additions & 2 deletions continuous_integration/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ install_conda()
echo 'conda-build ==1.18.1' > $HOME/miniconda/conda-meta/pinned;
conda install conda-build;
conda create -q -n test-environment python=$PY_VERSION;
conda install -q -y -n test-environment pytest pytest-cov pytest-qt
conda install -q -y -n test-environment pytest pytest-cov pytest-qt mock
fi
}

Expand All @@ -70,7 +70,7 @@ install_pip()
fi

# Install testing packages
pip install pytest pytest-cov pytest-qt
pip install pytest pytest-cov pytest-qt mock

# Install extra packages
EXTRA_PACKAGES="matplotlib pandas sympy pyzmq pillow"
Expand Down
5 changes: 4 additions & 1 deletion spyderlib/widgets/tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"""

# Standard library imports
from unittest.mock import Mock
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2

# Third party imports
import pytest
Expand Down

0 comments on commit 136112a

Please sign in to comment.