Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26147

Re: Initial nose experience

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!solaris.cc.vt.edu!news.vt.edu!newsfeed-00.mathworks.com!panix!roy
From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: Initial nose experience
Date Fri, 27 Jul 2012 10:51:48 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Lines 37
Message-ID <roy-5B2150.10514727072012@news.panix.com> (permalink)
References <roy-F2685A.08422113072012@news.panix.com>
NNTP-Posting-Host localhost
X-Trace reader1.panix.com 1343400710 7486 127.0.0.1 (27 Jul 2012 14:51:50 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Fri, 27 Jul 2012 14:51:50 +0000 (UTC)
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Xref csiph.com comp.lang.python:26147

Show key headers only | View raw


In article <roy-F2685A.08422113072012@news.panix.com>,
 Roy Smith <roy@panix.com> wrote:

> Lastly, nose, by default, doesn't say much.  When things go wrong and 
> you have no clue what's happening, --verbose and --debug are your 
> friends.

I found another example of nose not saying much, and this one is kind of 
annoying.  Unittest has much richer assertions, and better reporting 
when they fail.  If a nose assertion fails, you just get:

------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/roy/production/python/lib/python2.6/site-packages/nose/case.py", 
line 197, in runTest
    self.test(*self.arg)
  File "/home/roy/songza/pyza/djapi/test_middleware.py", line 48, in 
test_update_non_json_cookie
    assert user_list == [9990]
AssertionError
------------------------------------------------------------------

Under unittest, it would have printed the value of user_list.  Yeah, I 
know, I can stick a "print user_list" statement into the test, and the 
output will get suppressed if the test fails.  But that means when a 
test fails, I need to go back and edit the test code, which is a pain.

On the other hand, there *is* an incremental efficiency gain of writing:

assert x == y

instead of

assertEqual(x, y)

many times.  So maybe overall it's a wash.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Initial nose experience Roy Smith <roy@panix.com> - 2012-07-13 08:42 -0400
  Re: Initial nose experience python@bdurham.com - 2012-07-15 14:02 -0400
    Re: Initial nose experience Roy Smith <roy@panix.com> - 2012-07-15 14:58 -0400
      Re: Initial nose experience Philipp Hagemeister <phihag@phihag.de> - 2012-07-16 12:54 +0200
      Re: Initial nose experience Peter Otten <__peter__@web.de> - 2012-07-16 13:47 +0200
      unittest: Improve discoverability of discover (Was: Initial nose experience) Philipp Hagemeister <phihag@phihag.de> - 2012-07-16 14:37 +0200
        Re: unittest: Improve discoverability of discover Ben Finney <ben+python@benfinney.id.au> - 2012-07-16 22:45 +1000
      Re: unittest: Improve discoverability of discover (Was: Initial nose experience) Philipp Hagemeister <phihag@phihag.de> - 2012-07-16 14:49 +0200
    Re: Initial nose experience Roy Smith <roy@panix.com> - 2012-07-16 07:33 -0400
      Re: Initial nose experience Ben Finney <ben+python@benfinney.id.au> - 2012-07-16 22:37 +1000
  Re: Initial nose experience Roy Smith <roy@panix.com> - 2012-07-23 10:33 -0700
  Re: Initial nose experience Roy Smith <roy@panix.com> - 2012-07-27 10:51 -0400

csiph-web