Re: [myhdl-list] Pythonic Test frameworks
Brought to you by:
jandecaluwe
From: Uri N. <ur...@gm...> - 2011-11-09 21:42:10
|
On 9 November 2011 05:14, Christopher Felton <chr...@gm...> wrote: > On 11/8/11 9:01 PM, Christopher Felton wrote: > > On 11/8/11 7:04 PM, Bob Cunningham wrote: > >> On 11/07/2011 08:07 PM, Christopher Felton wrote: > >>> On 11/7/11 7:21 PM, Bob Cunningham wrote: > >>>> FWIW, py.test seems to be the way MyHDL itself is going... > >>>> > >>>> -BobC > >>> ... > >> > >>> The following, http://bit.ly/sc3vrI, is a brief mention of py.test > used > >>> instead of unittest (from a couple years ago) from the myhdl-list. > >>> > >>> But I do believe py.test is limited. If you are ok writing with only > >>> simple asserts, I believe py.test is ok. But unittest supports more > >>> advanced features, automatically verify raised exceptions (continue if > >>> raised fail if not). > >>> > >>> I guess an argument against py.test, is that it is another package that > >>> needs to be installed. Where as, unittest is part of the standard > >>> Python library, hmmm. > >>> > >>> Regards, > >>> Chris > >> > >> Well, MyHDL is, itself, "another package that needs to be installed"! > >> > >> See the end of this page: > http://www.myhdl.org/doku.php/cookbook:stopwatch > > > > Thanks for the reminder, this is a good commentary on py.test versus > > unittest. This is a good read for anyone trying to determine which test > > framework to use. > > I think this is the important quote from the py.test commentary at the > end of the stopwatch example. > > """ > However, I believe that the benefits are far more important than the > disadvantages. Moreover, some disadvantages may disappear over time. > Consequently, I plan to promote py.test as the unit testing framework of > choice for MyHDL in the future. > """ > > I don't think anything has changed since this was posted. > > Regards, > Chris > > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > Hi, Since I kind of started this py.test vs unittest discussion, I might as well add my own take :) IMO a non-standard library should have some really compelling feature to be required as a project's dependency, and unittest had fulfills all my needs: from regression framework for external (black box) testing, to pure Python and of course myHDL projects. A beneficial feature of py.test would appear to be its scalability across multiple processors. A remarkable feature of Nose (another popular framework, used by numpy) is the ability to generate tests using generators. Both however are a bit overkill for my purposes. Regarding the requirement of testing for exceptions - I would recommend checking the latest enhancements in 2.7, which made unittest even more comprehensive. Cheers, Uri |