1 new commit in pytest:

https://bitbucket.org/hpk42/pytest/changeset/bb0752e6ea8a/
changeset:   bb0752e6ea8a
user:        RonnyPfannschmidt
date:        2012-08-19 14:57:07
summary:     exchange the rawcode factory marker check with a more robust and 
specific instance check as advised by holger
affected #:  1 file

diff -r 60f144dcdcf4a488ef1114ead43a7d59df8f4663 -r 
bb0752e6ea8a545f84c955eeb0ec8e5bb0f26475 _pytest/python.py
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -1308,16 +1308,14 @@
             obj = getattr(holderobj, name)
             if not callable(obj):
                 continue
-            # to avoid breaking on magic global callables
-            # we explicitly check if we get a sane code object
-            # else having mock.call in the globals fails for example
-            code = py.code.getrawcode(obj)
-            if not inspect.iscode(code):
-                continue
             # resource factories either have a pytest_funcarg__ prefix
             # or are "funcarg" marked
             marker = getattr(obj, "_pytestfactory", None)
             if marker is not None:
+                if not isinstance(marker, FactoryMarker):
+                    # magic globals  with __getattr__
+                    # give us something thats wrong for that case
+                    continue
                 assert not name.startswith(self._argprefix)
                 argname = name
                 scope = marker.scope

Repository URL: https://bitbucket.org/hpk42/pytest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to