Skip to content

Commit a4e7e8e

Browse files
committed
skip pickle test if dill not importable
1 parent 8d88ce1 commit a4e7e8e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"""
2020

2121
import logging
22-
import dill
22+
try:
23+
import dill
24+
except ImportError:
25+
dill = False
2326

2427
from nameparser import HumanName
2528
from nameparser.util import u
@@ -78,8 +81,9 @@ def test_config_pickle(self):
7881
C = Constants()
7982
self.assertTrue(dill.pickles(C))
8083

84+
@unittest.skipUnless(dill,"requires python-dill module to test pickling")
8185
def test_name_instance_pickle(self):
82-
hn = HumanName("First Last")
86+
hn = HumanName("Title First Middle Middle Last, Jr.")
8387
self.assertTrue(dill.pickles(hn))
8488

8589
def test_comparison(self):

0 commit comments

Comments
 (0)