tag:blogger.com,1999:blog-524230429673765509.post7435619289082071554..comments2023-11-05T00:53:40.301-07:00Comments on pyright: Testing - baby steps (unittest)Carl Trachtehttp://www.blogger.com/profile/12363048245012413049noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-524230429673765509.post-4040751506787767672009-12-07T20:39:24.636-08:002009-12-07T20:39:24.636-08:00@Juho - Thanks for the feedback and direction. I ...@Juho - Thanks for the feedback and direction. I tried to implement your suggestions in an update.<br /><br />@Pedahzur - Thanks for the tip on setUp. I'm just not confident enough to assume anything right now. The module doc wasn't explicit (that I could tell) on this, so I refrained from assuming.Carl Trachtehttps://www.blogger.com/profile/12363048245012413049noreply@blogger.comtag:blogger.com,1999:blog-524230429673765509.post-73934938717656642582009-12-07T12:52:13.022-08:002009-12-07T12:52:13.022-08:00I've just started working with unittest as wel...I've just started working with unittest as well, and it's been fun. You might want to double check the documentation, but I'm pretty sure setUp is run automatically before every other test function in the class.Pedahzurhttps://www.blogger.com/profile/08531020477517782226noreply@blogger.comtag:blogger.com,1999:blog-524230429673765509.post-36226368083085318632009-12-06T23:38:02.421-08:002009-12-06T23:38:02.421-08:00Why not to separate testinterpfirstbyte and testin...Why not to separate testinterpfirstbyte and testinterpsubsqntbyte into classes of their own? It looks like it might make sense to split the commented parts as methods (unless they somehow depend on each other though I doubt that). Of course this means you have to define a superclass containing your setup method but that shouldn't be a problem.<br /><br />Also as you mentioned the usage of setUp method at the beginning of testreadchar and testgimmebyte looks suspicious. If there's some special reason for this, you should comment it in the code itself. Otherwise some poor maintenance coder would just get rid of those lines and have a nice WTF moment. :)Juho Vepsäläinenhttps://www.blogger.com/profile/08481088432274153896noreply@blogger.com