What steps will reproduce the problem? 1. import mock, copy 2. copy.copy(sentinel.foo) is sentinel.foo -> False
What is the expected output? What do you see instead? I would expect sentinels to not be copied; they are meant to be singletons.
What version of the product are you using? On what operating system? Ubuntu 14.10, python-mock 1.0.1-3 I also tested it on trunk.
Please provide any additional information below. In MAAS we have the following snippet in an early import to solve the problem:
# Make sure that sentinel objects are not copied. sentinel_type = type(mock.sentinel.foo) copy._copy_dispatch[sentinel_type] = copy._copy_immutable copy._deepcopy_dispatch[sentinel_type] = copy._copy_immutable
Status: New
Labels:
Type-Defect
Priority-Medium