Re: rewrote tests in unittest/ to python unittests
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Joerg Beyer wrote: > on popular request (by a single guy) I rewrote the tests in > the a-a-p directory Exec/unittest to be regular python > unittests. One advantage is, that the tests wont stop (sys.exit()) > if a single tests fail. > > Another advantage might be, that other coders could write > unittests, since they know how the usual python unittests > work. Thanks for making this, Joerg. I'll try it out... Looks like you included all the existing tests. Very good! I'll dump the old tests and use your new module. One thing I noticed is that you "import *" from Process. That is not a good idea, I'll change it to import assert_var_name only. For the Error and Util modules I do allow "import *", but Guido already made a remark about this... > I included the unittest.py (since Bram works with older > python releases that have it not includes - todays > python releases have). It originally lives on: > pyunit.sourceforge.net I'm using Python 2.2, which does include the module. Since the module is not required for normal use of Aap, and the module might change for future versions of Python, I think it's better not to include it. We can produce a warning when the module is not available, with a hint where to obtain the module. I suppose it's simple to install. I'll add something for this, please check the next version of Aap. > I attach a tarball, that should be unpacked in the Exec directory. > To run the tests just call: > joerg@home> python unittest/checks.py I'll add it to the test.aap recipe, so that "aap test" runs the tests. Hmm, I noticed assert_var_name() was tested in the wrong way (already in the old unittests)! The typelessness of Python didn't warn us for exchanging the two arguments... > Later I will append unittest, that actually run receipes to test, if they > work. This tarball tests on a lower layer: python functions and classes, > but the technique is the same. In what way would that be different from what is currently used to execute the tests in the "rectest" directory? -- A fine is a tax for doing wrong. A tax is a fine for doing well. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01