Skip to content

Commit

Permalink
Add code coverage for travis. Improve it to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Sep 13, 2016
1 parent dc4a8de commit 2a8c7b4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[run]
source = src

[report]
# Coverage is run on Linux under cPython 2 and 3,
# exclude branches that are windows
# specific
exclude_lines =
pragma: no cover

# def __repr__
# raise AssertionError
# raise NotImplementedError
# if __name__ == .__main__.:
# if PYPY:
# if sys.platform == 'win32':
# if mswindows:
# if is_windows:
# def oracle_
# class CXOracle
# class Oracle
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ bin
build
develop-eggs
parts
.coverage
htmlcov
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ python:
- 3.5
install:
- pip install -U pip
- pip install -U coverage coveralls
- pip install .[test]
script:
- python setup.py test -q
- coverage run setup.py test -q
after_success:
- coveralls
notifications:
email: false
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ CHANGES

- Dropped support for Python 2.6.

- Achieve 100% code test coverage.


1.0.0 (2013-03-01)
------------------
Expand Down Expand Up @@ -39,7 +41,7 @@ CHANGES
0.7.0 (2010-10-18)
------------------

- Updated tests to run with `zope.schema` >= 3.6, thus requiring at least
- Updated tests to run with ``zope.schema`` >= 3.6, thus requiring at least
this version.

- Using Python's ``doctest`` module instead of depreacted
Expand Down
3 changes: 1 addition & 2 deletions src/z3c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
except ImportError: # pragma: no cover
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)

8 changes: 8 additions & 0 deletions src/z3c/schema/regex/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ It does not validate regular expressions that do not compile.
...
InvalidRegex: '(i', unbalanced parenthesis

When used to process input, only valid values are returned

>>> regex.fromUnicode(u'.*')
'.*'
>>> regex.fromUnicode(u'(i')
Traceback (most recent call last):
...
InvalidRegex: '(i', unbalanced parenthesis

0 comments on commit 2a8c7b4

Please sign in to comment.