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
=================================== FAILURES ===================================
_______________ TestThreadLocalDict.test_non_dunder_proxy_works ________________
self = <tests.test_threadlocal.TestThreadLocalDict object at 0x23a7c50>
D = <class 'structlog.threadlocal.WrappedDict-f561929d-5fca-4b25-afcf-956a40968ad0'>
def test_non_dunder_proxy_works(self, D):
d = D({'a': 42})
> assert 1 == len(d)
E assert 1 == 2
E + where 2 = len(<WrappedDict-f561929d-5fca-4b25-afcf-956a40968ad0({'a': 42, 'b': 23})>)
tests/test_threadlocal.py:131: AssertionError
It appears that the greenlet wrapper does not create distinct dict classes on each call but just one that shares the same data store within one greenlet.
That shouldn’t be a problem in practice, but it’s contrary to what the docs say.
I wasn’t able to trigger this bug locally. The test is commented out as of 1995a8b.
The addition of unrelated code led to a test failure: https://travis-ci.org/hynek/structlog/builds/11921511
It appears that the greenlet wrapper does not create distinct dict classes on each call but just one that shares the same data store within one greenlet.
That shouldn’t be a problem in practice, but it’s contrary to what the docs say.
I wasn’t able to trigger this bug locally. The test is commented out as of 1995a8b.
/cc @hpk42
The text was updated successfully, but these errors were encountered: