Skip to content

Commit

Permalink
Add support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fperetti committed Nov 18, 2019
1 parent 58740f7 commit 8fe6f73
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -13,7 +13,9 @@ python:
- '3.6'
- pypy3

install: pip install tox-travis
install:
- if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then pip install virtualenv==15.2.0; fi
- pip install tox-travis
sudo: false

script: tox
Expand Down
16 changes: 11 additions & 5 deletions callee/collections.py
Expand Up @@ -3,7 +3,13 @@
"""
from __future__ import absolute_import

import collections
try:
import collections.abc
abc = collections.abc
except ImportError:
import collections
abc = collections

import inspect

from callee._compat import OrderedDict as _OrderedDict
Expand Down Expand Up @@ -71,7 +77,7 @@ def __repr__(self):
class Iterable(CollectionMatcher):
"""Matches any iterable."""

CLASS = collections.Iterable
CLASS = abc.Iterable

def __init__(self):
# Unfortunately, we can't allow an ``of`` argument to this matcher.
Expand Down Expand Up @@ -113,7 +119,7 @@ class Sequence(CollectionMatcher):
A sequence is an iterable that has a length and can be indexed.
"""
CLASS = collections.Sequence
CLASS = abc.Sequence


class List(CollectionMatcher):
Expand All @@ -125,7 +131,7 @@ class List(CollectionMatcher):
class Set(CollectionMatcher):
"""Matches a :class:`set` of given items."""

CLASS = collections.Set
CLASS = abc.Set


# TODO: Tuple matcher, with of= that accepts a tuple of matchers
Expand Down Expand Up @@ -243,7 +249,7 @@ def __repr__(self):
class Mapping(MappingMatcher):
"""Matches a mapping of given items."""

CLASS = collections.Mapping
CLASS = abc.Mapping


class Dict(MappingMatcher):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion=1.8
envlist=py26, py27, pypy, py33, py34, py35, py36, pypy3, flake8
envlist=py26, py27, pypy, py33, py34, py35, py36, py37, pypy3, flake8
skip_missing_interpreters=true

[testenv]
Expand Down

0 comments on commit 8fe6f73

Please sign in to comment.