I'm trying to work with one of the eggs in Plone (collective.z3cform.wizard). I'm following doctests while reading documentation and at this point would like to write tests for my own code.

The problem is that while I'm following test examples they differ from what I'm getting by running my tests. I would like to run tests on that third-party egg before looking for other solutions, the thing is -- I don't know how.

In Plone 3 it was possible to specify third-party tests through ./bin/instance test, when I'm trying to just run ./bin/test in Plone 4, I end up running only my development tests. So far I've tried using --module and --package options but all I seem to get is ImportErrors.

UPDATE: I'm justing buildout and here's a relevant part of it

[test]
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress']
eggs =
      ... my development eggs...
有帮助吗?

解决方案

The bin/test command is created by a buildout part, usually using the zc.recipe.testrunner or collective.xmltestreport recipes. Those recipes support an eggs entry to configure what eggs are available to it.

If you installed Plone with the unified installer, then the [test] part is set up to include the test-packages entry from the [buildout] section, so in your development.cfg you can add eggs to that entry as well to ensure the eggs you want to test are included.

To run all the tests for one package, use the -s option to bin/test:

bin/test -s collective.z3cform.wizard
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top