More unit test questions
OK, I got test.py running. But if I run bin/python test.py Products it will happily try to run the tests in all products. But if I type bin/python test.py Products/Productname It will find no tests at all. bin/python test.py Products/Productname/tests is no better. BUT! If I type bin/python test.py lib/python/Products/ZCTextIndex it does find the tests for ZCTextIndex. In short: Heuh? What are the difference that makes it impossible to test just one products unit test if it's located in Products instead of lib/python/Products. Or is there a difference in how the CMF tests are written? Anybody know?
Lennart Regebro wrote:
OK, I got test.py running. But if I run bin/python test.py Products it will happily try to run the tests in all products. But if I type bin/python test.py Products/Productname It will find no tests at all. bin/python test.py Products/Productname/tests is no better.
Mööp! I was wrong. In fact, I have so far been completely unable to run any unit tests outside of lib/python with test.py. Running "bin/python test.py Products" will run all tests in lib/python/Products. Hardly obvious I must say...
Lennart Regebro wrote:
Lennart Regebro wrote:
OK, I got test.py running. But if I run bin/python test.py Products it will happily try to run the tests in all products. But if I type bin/python test.py Products/Productname It will find no tests at all. bin/python test.py Products/Productname/tests is no better.
Mööp! I was wrong. In fact, I have so far been completely unable to run any unit tests outside of lib/python with test.py.
Running "bin/python test.py Products" will run all tests in lib/python/Products. Hardly obvious I must say...
The easiest way is to run test.py from within zopectl. This way you don't have to care about Zope configuration. test.py --help shows you the available options. These work for me on linux: $ path/to/zopectl run path/to/test.py --libdir path/to/Products -v $ path/to/zopectl run path/to/test.py --libdir path/to/Products/CMFCore -v HTH, Yuppie
Lennart Regebro wrote at 2004-8-20 17:39 +0200:
OK, I got test.py running. But if I run bin/python test.py Products
This should probably be: ... test.py --libdir Products Note also, that "test.py" treats symbolic links in an unexpected way (it resolves the path and may then no longer find its library). -- Dieter
participants (3)
-
Dieter Maurer -
Lennart Regebro -
yuppie