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 ...@@ -3,12 +3,8 @@ build
dist dist
slapos.recipe.template.egg-info slapos.recipe.template.egg-info
# buildout files # "setup.py test"-installed eggs
bin /zc.buildout-*.egg
develop-eggs
eggs
parts
.installed.cfg
# Editor backupfiles # Editor backupfiles
.*.swp .*.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" + \ ...@@ -8,8 +8,6 @@ long_description = open("README.txt").read() + "\n" + \
'template', "README.txt")).read() + "\n" + \ 'template', "README.txt")).read() + "\n" + \
open("CHANGES.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, setup(name=name,
version=version, version=version,
description="Templating recipe with remote resource support.", description="Templating recipe with remote resource support.",
...@@ -28,11 +26,9 @@ setup(name=name, ...@@ -28,11 +26,9 @@ setup(name=name,
'zc.buildout', # plays with buildout 'zc.buildout', # plays with buildout
], ],
zip_safe=True, zip_safe=True,
extras_require={
'test': 'zope.testing',
},
entry_points={ entry_points={
'zc.buildout': [ 'zc.buildout': [
'default = slapos.recipe.template:Recipe', '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:: ...@@ -205,7 +205,7 @@ Let's just use ``buildout.cfg`` using this egg::
... recipe = samplerecipe ... recipe = samplerecipe
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
Develop: '/sample-buildout/.' Develop: ...
Uninstalling template. Uninstalling template.
Uninstalling dependency. Uninstalling dependency.
Installing sample. 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 # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential # programmers who take the whole responsibility of assessing all potential
...@@ -24,29 +24,25 @@ ...@@ -24,29 +24,25 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import doctest
import unittest import unittest
from zc.buildout import testing
import zc.buildout.testing
from zope.testing import doctest, renormalizing
def setUp(test): def setUp(test):
zc.buildout.testing.buildoutSetUp(test) testing.buildoutSetUp(test)
zc.buildout.testing.install_develop('slapos.recipe.template', test) testing.install_develop('slapos.recipe.template', test)
zc.buildout.testing.install('zope.testing', test)
checker = renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
]
)
def test_suite(): def test_suite():
files = ['README.txt', return unittest.TestSuite([
doctest.DocFileSuite(
filename,
setUp=setUp,
tearDown=testing.buildoutTearDown,
optionflags=doctest.ELLIPSIS,
) for filename in [
'README.txt',
] ]
return unittest.TestSuite([doctest.DocFileSuite(filename, setUp=setUp, ])
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.ELLIPSIS, checker=checker)
for filename in files])
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(defaultTest='test_suite') 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