Seems to be a problem in coverage. This narrows down a problem that was
first seen only when running inside Bitten.
$ cat c.py
def foo(somearg):
class Bar(object):
def __getattr__(self, attribute):
return getattr(somearg, attribute)
assert 'somearg' not in Bar.__dict__
foo('hi')
$ python c.py
$ coverage -e
$ coverage -x c.py
Traceback (most recent call last):
File "/Users/jek/bin/coverage", line 8, in <module>
load_entry_point('coverage==2.80', 'console_scripts', 'coverage')()
File "build/bdist.macosx-10.5-i386/egg/coverage.py", line 978, in main
File "build/bdist.macosx-10.5-i386/egg/coverage.py", line 398, in
command_line
File "c.py", line 8, in <module>
foo('hi')
File "c.py", line 6, in foo
assert 'somearg' not in Bar.__dict__
AssertionError
I've seen this identical issue with Bitten, and its not a SQLAlchemy
one.
Here's the ticket: http://www.sqlalchemy.org/trac/ticket/1138
Replace your test case with this script:
def foo(somearg):
class Bar(object):
def __getattr__(self, attribute):
return getattr(somearg, attribute)
assert 'somearg' not in Bar.__dict__
foo('hi')
I just ran it with the "coverage.py" that we have in SQLAlchemy and
the bug reproduces.
>
> With some help from Ned Batchelder I was able to confirm that this is
> a Python bug: http://bugs.python.org/issue1569356 that has been fixed
> since the 2.5.2 release. Ned confirmed that the fix is included in
> Python 2.6a3.
well thats....peachy. I suppose we might have to find a way to work
around it in SQLA (changing names in that area I think).