Skip to content

Commit

Permalink
Merge 7f6f487 into f8cbcc6
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-dlp committed Oct 20, 2018
2 parents f8cbcc6 + 7f6f487 commit f8e04ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ matrix:
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='True'
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
os: osx
- env: export PYTHON=3.7; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
language: generic
allow_failures:
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='True'; MINIMAL_ENV='False'
Expand Down
2 changes: 1 addition & 1 deletion hyperspy/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# When running setup.py the ".dev" string will be replaced (if possible)
# by the output of "git describe" if git is available or the git
# hash if .git is present.
version = "1.4.1.dev"
version = "1.4.1"
description = "Multidimensional data analysis toolbox"
license = 'GPL v3'

Expand Down
2 changes: 1 addition & 1 deletion hyperspy/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def add_np(doctest_namespace):
def setup_module(mod):
if pytest.config.getoption("--pdb"):
import dask
dask.set_options(get=dask.async.get_sync)
dask.set_options(get=dask.local.get_sync)


@pytest.fixture
Expand Down
11 changes: 10 additions & 1 deletion hyperspy/misc/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with HyperSpy. If not, see <http://www.gnu.org/licenses/>.

import os
import sys
from contextlib import contextmanager
import warnings
import re
Expand All @@ -34,6 +35,14 @@ def ignore_warning(message="", category=None):
warnings.filterwarnings('ignore', message)
yield

# In Python 3.7, the private re._pattern_type is removed.
# Python 3.5+ have typing.re.Pattern
# Solution adapted from Pandas
if sys.version_info >= (3, 5):
import typing
Pattern = typing.re.Pattern
else:
Pattern = type(re.compile(''))

# TODO: Remove _all_warnings when moved to Python > 3.4,
# ref http://bugs.python.org/issue4180
Expand Down Expand Up @@ -148,7 +157,7 @@ def assert_warns(message=None, category=None):
If you use the "|" operator in a pattern, you can catch one of several warnings.
Finally, you can use "|\A\Z" in a pattern to signify it as optional.
"""
if isinstance(message, (str, re._pattern_type)):
if isinstance(message, (str, Pattern)):
message = [message]
elif message is None:
message = tuple()
Expand Down

0 comments on commit f8e04ce

Please sign in to comment.