mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Clear caches per test rather than per class
This commit is contained in:
parent
1e5de81544
commit
a8cb5c96ba
@ -21,16 +21,14 @@ class TestHyphenation(unittest.TestCase):
|
|||||||
|
|
||||||
ae = unittest.TestCase.assertEqual
|
ae = unittest.TestCase.assertEqual
|
||||||
|
|
||||||
@classmethod
|
def setUp(cls):
|
||||||
def setUpClass(cls):
|
|
||||||
tdir = PersistentTemporaryDirectory()
|
tdir = PersistentTemporaryDirectory()
|
||||||
path_to_dictionary.cache_dir = tdir
|
path_to_dictionary.cache_dir = tdir
|
||||||
dictionary_name_for_locale.cache_clear()
|
dictionary_name_for_locale.cache_clear()
|
||||||
dictionary_for_locale.cache_clear()
|
dictionary_for_locale.cache_clear()
|
||||||
get_cache_path.cache_clear()
|
get_cache_path.cache_clear()
|
||||||
|
|
||||||
@classmethod
|
def tearDown(self):
|
||||||
def tearDownClass(cls):
|
|
||||||
dictionary_name_for_locale.cache_clear()
|
dictionary_name_for_locale.cache_clear()
|
||||||
dictionary_for_locale.cache_clear()
|
dictionary_for_locale.cache_clear()
|
||||||
get_cache_path.cache_clear()
|
get_cache_path.cache_clear()
|
||||||
@ -71,12 +69,11 @@ class TestHyphenation(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertFalse(cache[0])
|
self.assertFalse(cache[0])
|
||||||
|
|
||||||
def test_remove_punctuation(self):
|
def test_add_soft_hyphens(self):
|
||||||
self.ae(remove_punctuation('word'), ('', 'word', ''))
|
self.ae(remove_punctuation('word'), ('', 'word', ''))
|
||||||
self.ae(remove_punctuation('wo.rd.'), ('', 'wo.rd', '.'))
|
self.ae(remove_punctuation('wo.rd.'), ('', 'wo.rd', '.'))
|
||||||
self.ae(remove_punctuation('"«word!!'), ('"«', 'word', '!!'))
|
self.ae(remove_punctuation('"«word!!'), ('"«', 'word', '!!'))
|
||||||
|
|
||||||
def test_add_soft_hyphens(self):
|
|
||||||
dictionary = dictionary_for_locale('en')
|
dictionary = dictionary_for_locale('en')
|
||||||
|
|
||||||
def t(word, expected):
|
def t(word, expected):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user