Andy McKay

Dec 27, 2012

Saved by a nose-blockage


Was slightly pleased to see today that nose-blockage saved our test suite. A change in the django-browserid library meant that on each call to login in our test suite, it was going to make a HTTP request to verifier.login.persona.org.

Fortunately nose-blockage stops that request and 1,012 tests failed. If we didn't have that blockage in place, out test suite would have made over 1,012 HTTP requests to the persona.org server on each test run. That would have made our test suite slower and dependent on an external service. Not a big issue to fix, but this is a really good example of why nose-blockage can be useful to save you from libraries that change. Example failure:

-------------------- >> begin captured logging << --------------------
django_browserid.base: INFO: Verification URL: https://verifier.login.persona.org/verify
requests.packages.urllib3.connectionpool: INFO: Starting new HTTPS connection (1): verifier.login.persona.org
blockage.plugins: WARNING: Denied HTTP connection to: verifier.login.persona.org
--------------------- >> end captured logging << ---------------------