def test_new_binds_only_initial_values_explicit_ctx_class(self, proxy): proxy = BoundLoggerLazyProxy(None, initial_values={ "a": 1, "b": 2 }, context_class=dict) b = proxy.new(foo=42) assert {"a": 1, "b": 2, "foo": 42} == b._context
def test_new_binds_only_initial_values_implicit_ctx_class(self, proxy): """ new() doesn't clear initial_values if context_class comes from config. """ proxy = BoundLoggerLazyProxy(None, initial_values={"a": 1, "b": 2}) b = proxy.new(foo=42) assert {"a": 1, "b": 2, "foo": 42} == b._context
def test_new_binds_only_initial_values_explicit_ctx_class(self, proxy): """ new() doesn't clear initial_values if context_class is passed explicitly.. """ proxy = BoundLoggerLazyProxy(None, initial_values={ "a": 1, "b": 2 }, context_class=dict) b = proxy.new(foo=42) assert {"a": 1, "b": 2, "foo": 42} == b._context
def test_new_binds_only_initial_values_explicit_ctx_class(self, proxy): proxy = BoundLoggerLazyProxy(None, initial_values={"a": 1, "b": 2}, context_class=dict) b = proxy.new(foo=42) assert {"a": 1, "b": 2, "foo": 42} == b._context
def test_new_binds_only_initial_values_impolicit_ctx_class(self, proxy): proxy = BoundLoggerLazyProxy(None, initial_values={'a': 1, 'b': 2}) b = proxy.new(foo=42) assert {'a': 1, 'b': 2, 'foo': 42} == b._context