Skip to content

Commit

Permalink
Merge pull request #1 from zopefoundation/sylvain-update-toolkit-vers…
Browse files Browse the repository at this point in the history
…ions

Sylvain update toolkit versions
  • Loading branch information
thefunny42 committed Jan 29, 2016
2 parents 8cbb9d1 + 601b005 commit 1fe4c3e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: python
python:
- 2.6
- 2.7
install:
- python bootstrap.py
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changes
1.6 (unreleased)
----------------

- Nothing changed yet.
- Update tests.


1.5 (2014-10-20)
Expand Down
8 changes: 6 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
recursive-include src/grokcore/annotation *.*
global-include *.mo
include *.txt
global-exclude *pyc
include *.rst
include bootstrap.py
include buildout.cfg
include .travis.yml
recursive-include src *.py *.zcml
2 changes: 2 additions & 0 deletions src/grokcore/annotation/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
from grokcore.component import zcml
# Provide this import here for BBB reasons:


def grok(module_name):
config = ConfigurationMachine()
zcml.do_grok('grokcore.component.meta', config)
zcml.do_grok('grokcore.annotation.meta', config)
zcml.do_grok(module_name, config)
config.execute_actions()


def warn(message, category=None, stacklevel=1):
"""Intended to replace warnings.warn in tests.
Expand Down
29 changes: 18 additions & 11 deletions src/grokcore/annotation/tests/test_grok.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import doctest
import re
import unittest
from pkg_resources import resource_listdir
from zope.testing import doctest, cleanup, renormalizing

from zope.testing import cleanup, renormalizing
import zope.component.eventtesting


def setUpZope(test):
zope.component.eventtesting.setUp(test)


def cleanUpZope(test):
cleanup.cleanUp()


checker = renormalizing.RENormalizing([
# str(Exception) has changed from Python 2.4 to 2.5 (due to
# Exception now being a new-style class). This changes the way
# exceptions appear in traceback printouts.
(re.compile(r"ConfigurationExecutionError: <class '([\w.]+)'>:"),
r'ConfigurationExecutionError: \1:'),
])
(re.compile(
r"ConfigurationExecutionError: <class '([\w.]+)'>:"),
r'ConfigurationExecutionError: \1:')])


def suiteFromPackage(name):
files = resource_listdir(__name__, name)
Expand All @@ -30,19 +36,20 @@ def suiteFromPackage(name):
continue

dottedname = 'grokcore.annotation.tests.%s.%s' % (name, filename[:-3])
test = doctest.DocTestSuite(dottedname,
setUp=setUpZope,
tearDown=cleanUpZope,
checker=checker,
optionflags=doctest.ELLIPSIS+
doctest.NORMALIZE_WHITESPACE)
test = doctest.DocTestSuite(
dottedname,
setUp=setUpZope,
tearDown=cleanUpZope,
checker=checker,
optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE)

suite.addTest(test)
return suite


def test_suite():
suite = unittest.TestSuite()
for name in ['annotation',]:
for name in ['annotation', ]:
suite.addTest(suiteFromPackage(name))
return suite

Expand Down

0 comments on commit 1fe4c3e

Please sign in to comment.