On Wed, 25 Feb 2015 15:47:46 -0500
Doug Hellmann <d...@doughellmann.com> wrote:
> I think the rule originally came from the way mock works. If you
> import a thing in your module and then a test tries to mock where it
> came from, your module still uses the version it imported because the
> name lookup isn't done again at the point when the test runs. If all
> external symbols are accessed through the module that contains them,
> then the lookup is done at runtime instead of import time and mocks
> can replace the symbols. The same benefit would apply to monkey
> patching like what eventlet does, though that's less likely to come
> up in our own code than it is for third-party and stdlib modules.

I strongly agree, when source code does "from module import SomeClass"
is a nightmare patch it at runtime.

Those were my 2 cents to the discussion :)
-- 
Felipe Reyes (GPG:0x9B1FFF39)
http://tty.cl
lp:~freyes | freyes@freenode | freyes@github

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to