Skip to content

Commit 251b189

Browse files
committed
catch deprecation warnings
1 parent 574885f commit 251b189

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/test_tokenize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_word_tokenize(self):
7878
word_tokenize("รถไฟฟ้าBTS", custom_dict=DEFAULT_DICT_TRIE)
7979
)
8080

81-
with self.assertRaises(DeprecationWarning):
81+
with self.assertWarns(DeprecationWarning):
8282
dict_word_tokenize("เลิกใช้แล้ว")
8383

8484
def test_Tokenizer(self):

tests/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def test_delete_tone(self):
244244
self.assertEqual(delete_tone("จิ้น"), "จิน")
245245
self.assertEqual(delete_tone("เก๋า"), "เกา")
246246

247-
with self.assertRaises(DeprecationWarning):
247+
with self.assertWarns(DeprecationWarning):
248248
deletetone("จิ้น")
249249

250250
def test_normalize(self):
@@ -293,5 +293,5 @@ def test_is_native_thai(self):
293293
self.assertEqual(is_native_thai("เทเวศน์"), False)
294294
self.assertEqual(is_native_thai("เทเวศร์"), False)
295295

296-
with self.assertRaises(DeprecationWarning):
296+
with self.assertWarns(DeprecationWarning):
297297
thaicheck("เลข")

0 commit comments

Comments
 (0)