boltons/tests/test_typeutils.py

19 lines
379 B
Python
Raw Normal View History

2024-10-17 00:40:37 +00:00
import copy
import pickle
from boltons.typeutils import make_sentinel
NOT_SET = make_sentinel('not_set', var_name='NOT_SET')
def test_sentinel_falsiness():
assert not NOT_SET
def test_sentinel_pickle():
assert pickle.dumps(NOT_SET)
2024-10-17 00:40:37 +00:00
def test_sentinel_copy():
test = make_sentinel('test')
assert test is copy.copy(test)
assert test is copy.deepcopy(test)