Skip to content

Commit

Permalink
Merge pull request #651 from nipy/ci/travis_py37
Browse files Browse the repository at this point in the history
CI: Test on Python 3.7 on Travis and AppVeyor
  • Loading branch information
matthew-brett committed Sep 28, 2018
2 parents be35aca + 25f08b7 commit 436df7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
# for it to be on multiple physical lines, so long as you remember: - There
# can't be any leading "-"s - All newlines will be removed, so use ";"s

dist: xenial
sudo: true
language: python

# Run jobs on container-based infrastructure, can be overridden per job
sudo: false

cache:
directories:
- $HOME/.cache/pip
Expand All @@ -22,11 +21,14 @@ env:
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
python:
- 3.4
- 3.5
- 3.6
- 3.7
matrix:
include:
- python: 3.4
dist: trusty
sudo: false
- python: 2.7
env:
- COVERAGE=1
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ environment:
- PYTHON: C:\Python35-x64
- PYTHON: C:\Python36
- PYTHON: C:\Python36-x64
- PYTHON: C:\Python37
- PYTHON: C:\Python37-x64

install:
# Prepend newly installed Python to the PATH of this build (this cannot be
Expand Down
4 changes: 2 additions & 2 deletions nibabel/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class FutureWarningMixin(object):
>>> with warnings.catch_warnings(record=True) as warns:
... d = D()
... warns[0].message
FutureWarning("Please, don't use this class",)
... warns[0].message.args[0]
"Please, don't use this class"
"""
warn_message = 'This class will be removed in future versions'

Expand Down
7 changes: 2 additions & 5 deletions nibabel/tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_assert_allclose_safely():

def assert_warn_len_equal(mod, n_in_context):
mod_warns = mod.__warningregistry__
# Python 3.4 appears to clear any pre-existing warnings of the same type,
# Python 3 appears to clear any pre-existing warnings of the same type,
# when raising warnings inside a catch_warnings block. So, there is a
# warning generated by the tests within the context manager, but no
# previous warnings.
Expand All @@ -84,18 +84,15 @@ def test_clear_and_catch_warnings():
assert_equal(my_mod.__warningregistry__, {})
# Without specified modules, don't clear warnings during context
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Some warning')
assert_warn_len_equal(my_mod, 1)
# Confirm that specifying module keeps old warning, does not add new
with clear_and_catch_warnings(modules=[my_mod]):
warnings.simplefilter('ignore')
warnings.warn('Another warning')
assert_warn_len_equal(my_mod, 1)
# Another warning, no module spec does add to warnings dict, except on
# Python 3.4 (see comments in `assert_warn_len_equal`)
# Python 3 (see comments in `assert_warn_len_equal`)
with clear_and_catch_warnings():
warnings.simplefilter('ignore')
warnings.warn('Another warning')
assert_warn_len_equal(my_mod, 2)

Expand Down

0 comments on commit 436df7c

Please sign in to comment.