MCPcopy Create free account
hub / github.com/ipython/traitlets / test_dict_default_value

Function test_dict_default_value

tests/test_traitlets.py:1945–1956  ·  view source on GitHub ↗

Check that the `{}` default value of the Dict traitlet constructor is actually copied.

()

Source from the content-addressed store, hash-verified

1943
1944
1945def test_dict_default_value():
1946 """Check that the `{}` default value of the Dict traitlet constructor is
1947 actually copied."""
1948
1949 class Foo(HasTraits):
1950 d1 = Dict()
1951 d2 = Dict()
1952
1953 foo = Foo()
1954 assert foo.d1 == {}
1955 assert foo.d2 == {}
1956 assert foo.d1 is not foo.d2
1957
1958
1959class TestValidationHook(TestCase):

Callers

nothing calls this directly

Calls 1

FooClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…