Commit 577fb26a authored by Vincent Pelletier's avatar Vincent Pelletier

Switch to "setup.py test" to run tests.

Buildout way couldn't install some (dependency) eggs for an unknown reason
(zope.exception on some python environments, Jinja2 needed by a future
extension...) and "setup.py test" just works, with fewer lines at this.
Also, drop zope.testing dependency altogether:
- zope.testing.doctest is deprecated
- zope.testing.renormalizing is not really needed for this test
parent a7330aba
......@@ -3,12 +3,8 @@ build
dist
slapos.recipe.template.egg-info
# buildout files
bin
develop-eggs
eggs
parts
.installed.cfg
# "setup.py test"-installed eggs
/zc.buildout-*.egg
# Editor backupfiles
.*.swp
......
[buildout]
parts = test
develop = .
[test]
recipe = zc.recipe.testrunner
eggs = slapos.recipe.template [test]
......@@ -8,8 +8,6 @@ long_description = open("README.txt").read() + "\n" + \
'template', "README.txt")).read() + "\n" + \
open("CHANGES.txt").read() + "\n"
# extras_requires are not used because of
# https://bugs.launchpad.net/zc.buildout/+bug/85604
setup(name=name,
version=version,
description="Templating recipe with remote resource support.",
......@@ -28,11 +26,9 @@ setup(name=name,
'zc.buildout', # plays with buildout
],
zip_safe=True,
extras_require={
'test': 'zope.testing',
},
entry_points={
'zc.buildout': [
'default = slapos.recipe.template:Recipe',
]},
test_suite = "slapos.recipe.template.tests.test_suite",
)
......@@ -205,7 +205,7 @@ Let's just use ``buildout.cfg`` using this egg::
... recipe = samplerecipe
... ''')
>>> print system(join('bin', 'buildout')),
Develop: '/sample-buildout/.'
Develop: ...
Uninstalling template.
Uninstalling dependency.
Installing sample.
......
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
# Copyright (c) 2010-2012 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
......@@ -24,29 +24,25 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import doctest
import unittest
import zc.buildout.testing
from zope.testing import doctest, renormalizing
from zc.buildout import testing
def setUp(test):
zc.buildout.testing.buildoutSetUp(test)
zc.buildout.testing.install_develop('slapos.recipe.template', test)
zc.buildout.testing.install('zope.testing', test)
checker = renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
]
)
testing.buildoutSetUp(test)
testing.install_develop('slapos.recipe.template', test)
def test_suite():
files = ['README.txt',
]
return unittest.TestSuite([doctest.DocFileSuite(filename, setUp=setUp,
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.ELLIPSIS, checker=checker)
for filename in files])
return unittest.TestSuite([
doctest.DocFileSuite(
filename,
setUp=setUp,
tearDown=testing.buildoutTearDown,
optionflags=doctest.ELLIPSIS,
) for filename in [
'README.txt',
]
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment