You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be awesome if there was eg. a decorator that would cause a test case to be ignored by nose-detecthttp.
Use case: possibly not common, but I have a regression test for a failure that happens deep in httplib when any header is of type unicode and the body contains binary data. (On python 2.7 this causes UnicodeDecodeError).
I can't use VCR for this regression test because it would intercept the call at too high a level (up in httplib2). So I want to instead mock.patch a method in httplib itself, deep enough to prevent network access, but still allow the error condition to be triggered.
Since we're using nose-detecthttp, I can't do that without it complaining every time I run the test. And if I decorate my test method with use_cassette, then vcr intercepts the call at too high a level (up in httplib2) and the bug would never actually be triggered. So my regression test case is no longer verifying that my bugfix hasn't regressed ... it will always pass unless I force vcr to re-record.
The text was updated successfully, but these errors were encountered:
Would a nose attr be a reasonable place to put this flag? I haven't seen them used that way before, but it's the easiest place I can think to put this.
Hm, this turns out to not be as straightforward as I thought. I'm having trouble getting access to the actual method inside startTest because of the way nose structures test cases.
Here's a workaround until I think of a better way to do this: add an attr no-detecthttp to the tests you want to skip. Then run your test suite with:
nosetests -a '!no-detecthttp' --with-detecthttp && nosetests -a 'no-detecthttp'
It would be awesome if there was eg. a decorator that would cause a test case to be ignored by nose-detecthttp.
Use case: possibly not common, but I have a regression test for a failure that happens deep in httplib when any header is of type unicode and the body contains binary data. (On python 2.7 this causes UnicodeDecodeError).
I can't use VCR for this regression test because it would intercept the call at too high a level (up in httplib2). So I want to instead mock.patch a method in httplib itself, deep enough to prevent network access, but still allow the error condition to be triggered.
Since we're using nose-detecthttp, I can't do that without it complaining every time I run the test. And if I decorate my test method with use_cassette, then vcr intercepts the call at too high a level (up in httplib2) and the bug would never actually be triggered. So my regression test case is no longer verifying that my bugfix hasn't regressed ... it will always pass unless I force vcr to re-record.
The text was updated successfully, but these errors were encountered: