We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d882d9 commit 493b0d2Copy full SHA for 493b0d2
1 file changed
25-class-metaprog/sentinel/sentinel_test.py
@@ -1,3 +1,5 @@
1
+import pickle
2
+
3
from sentinel import Sentinel
4
5
class PlainSentinel(Sentinel): pass
@@ -12,12 +14,17 @@ def test_repr():
12
14
13
15
16
def test_pickle():
- from pickle import dumps, loads
- s = dumps(PlainSentinel)
17
- ps = loads(s)
+ s = pickle.dumps(PlainSentinel)
18
+ ps = pickle.loads(s)
19
assert ps is PlainSentinel
20
21
22
def test_custom_repr():
23
assert repr(SentinelCustomRepr) == '***SentinelRepr***'
-
24
25
26
+def test_sentinel_comes_ready_to_use():
27
+ assert repr(Sentinel) == 'Sentinel'
28
+ s = pickle.dumps(Sentinel)
29
30
+ assert ps is Sentinel
0 commit comments