diff options
| author | Colin Watson <cjwatson@debian.org> | 2021-01-04 16:02:39 +0000 |
|---|---|---|
| committer | Colin Watson <cjwatson@debian.org> | 2021-01-04 16:02:39 +0000 |
| commit | d0be1a20bd2f512b3cabe182f617b87f6d20619a (patch) | |
| tree | 84761cc57b136fbc3ba3e23d4ee1dec1988f7d10 | |
| parent | 6de25be8e9b9b13d60b98b973c216e9ad949dd96 (diff) | |
| download | zope-schema-d0be1a20bd2f512b3cabe182f617b87f6d20619a.tar.gz | |
Use coverage-python-version
| -rw-r--r-- | .coveragerc | 1 | ||||
| -rw-r--r-- | src/zope/schema/_bootstrapfields.py | 4 | ||||
| -rw-r--r-- | src/zope/schema/_field.py | 2 | ||||
| -rw-r--r-- | src/zope/schema/tests/__init__.py | 4 | ||||
| -rw-r--r-- | tox.ini | 1 |
5 files changed, 7 insertions, 5 deletions
diff --git a/.coveragerc b/.coveragerc index 953ece6..617e435 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,5 @@ [run] +plugins = coverage_python_version source = zope.schema [report] diff --git a/src/zope/schema/_bootstrapfields.py b/src/zope/schema/_bootstrapfields.py index f33e332..6f2906b 100644 --- a/src/zope/schema/_bootstrapfields.py +++ b/src/zope/schema/_bootstrapfields.py @@ -761,9 +761,9 @@ class Number(Orderable, Field): # On Python 2, native strings are byte strings, which is # what the converters expect, so we don't need to do any decoding. - if PY2: # pragma: no cover + if PY2: # pragma: PY2 fromBytes = fromUnicode - else: + else: # pragma: PY3 def fromBytes(self, value): return self.fromUnicode(value.decode('utf-8')) diff --git a/src/zope/schema/_field.py b/src/zope/schema/_field.py index 99f40e8..3e42f67 100644 --- a/src/zope/schema/_field.py +++ b/src/zope/schema/_field.py @@ -17,7 +17,7 @@ __docformat__ = 'restructuredtext' try: from collections import abc -except ImportError: # pragma: no cover +except ImportError: # pragma: PY2 # Python 2 import collections as abc diff --git a/src/zope/schema/tests/__init__.py b/src/zope/schema/tests/__init__.py index c80dc02..f6718f0 100644 --- a/src/zope/schema/tests/__init__.py +++ b/src/zope/schema/tests/__init__.py @@ -11,7 +11,7 @@ def _make_transforms(patterns): return [(re.compile(pattern), repl) for pattern, repl in patterns] -if PY3: +if PY3: # pragma: PY3 py3_checker = renormalizing.RENormalizing(_make_transforms([ (r"u'([^']*)'", r"'\1'"), @@ -44,7 +44,7 @@ if PY3: (r"zope.schema._bootstrapinterfaces.WrongType:", r"WrongType:"), ])) -else: # pragma: no cover +else: # pragma: PY2 py3_checker = renormalizing.RENormalizing(_make_transforms([ (r"([^'])b'([^']*)'", r"\1'\2'"), @@ -32,6 +32,7 @@ commands = deps = .[test] coverage + coverage-python-version [testenv:docs] basepython = |
