Skip to content

Commit

Permalink
MAINT CI Adds support for pytest 5 (#14454)
Browse files Browse the repository at this point in the history
* TST Uses latest pytest

* TST Only run conda

* BLD Uses latest version of pytest-xdist

* ENH Ignore in show_version

* REV Uses latest pytest version

* MAINT Pins pytest to 4 in one instance
  • Loading branch information
thomasjpfan authored and adrinjalali committed Jul 24, 2019
1 parent 55895bc commit 243d052
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 3 additions & 2 deletions azure-pipelines.yml
Expand Up @@ -22,6 +22,7 @@ jobs:
SCIPY_VERSION: '0.17.0'
PANDAS_VERSION: '*'
CYTHON_VERSION: '*'
PYTEST_VERSION: '*'
PILLOW_VERSION: '4.0.0'
MATPLOTLIB_VERSION: '1.5.1'
# later version of joblib are not packaged in conda for Python 3.5
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
SCIPY_VERSION: '*'
CYTHON_VERSION: '*'
PILLOW_VERSION: '*'
PYTEST_VERSION: '4.6.2'
PYTEST_VERSION: '*'
JOBLIB_VERSION: '*'
COVERAGE: 'true'

Expand All @@ -84,7 +85,7 @@ jobs:
PYTHON_VERSION: '3.7'
CHECK_WARNINGS: 'true'
PYTHON_ARCH: '64'
PYTEST_VERSION: '4.6.2'
PYTEST_VERSION: '*'
COVERAGE: 'true'
py35_pip_openblas_32bit:
PYTHON_VERSION: '3.5'
Expand Down
3 changes: 2 additions & 1 deletion build_tools/azure/install.cmd
Expand Up @@ -11,9 +11,10 @@ IF "%PYTHON_ARCH%"=="64" (
call deactivate
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %VIRTUALENV%
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython matplotlib pytest=%PYTEST_VERSION% wheel pillow joblib pytest-xdist
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython matplotlib pytest=%PYTEST_VERSION% wheel pillow joblib

call activate %VIRTUALENV%
pip install pytest-xdist
) else (
pip install numpy scipy cython pytest wheel pillow joblib
)
Expand Down
5 changes: 2 additions & 3 deletions build_tools/azure/install.sh
Expand Up @@ -51,12 +51,11 @@ if [[ "$DISTRIB" == "conda" ]]; then
TO_INSTALL="$TO_INSTALL matplotlib=$MATPLOTLIB_VERSION"
fi

make_conda $TO_INSTALL
if [[ "$PYTHON_VERSION" == "*" ]]; then
TO_INSTALL="$TO_INSTALL pytest-xdist"
pip install pytest-xdist
fi

make_conda $TO_INSTALL

elif [[ "$DISTRIB" == "ubuntu" ]]; then
sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
sudo apt-get install python3-scipy python3-matplotlib libatlas3-base libatlas-base-dev libatlas-dev python3-virtualenv
Expand Down
10 changes: 7 additions & 3 deletions sklearn/utils/tests/test_show_versions.py
Expand Up @@ -2,6 +2,7 @@
from sklearn.utils._show_versions import _get_sys_info
from sklearn.utils._show_versions import _get_deps_info
from sklearn.utils._show_versions import show_versions
from sklearn.utils.testing import ignore_warnings


def test_get_sys_info():
Expand All @@ -13,7 +14,8 @@ def test_get_sys_info():


def test_get_deps_info():
deps_info = _get_deps_info()
with ignore_warnings():
deps_info = _get_deps_info()

assert 'pip' in deps_info
assert 'setuptools' in deps_info
Expand All @@ -27,7 +29,9 @@ def test_get_deps_info():


def test_show_versions(capsys):
show_versions()
out, err = capsys.readouterr()
with ignore_warnings():
show_versions()
out, err = capsys.readouterr()

assert 'python' in out
assert 'numpy' in out

0 comments on commit 243d052

Please sign in to comment.