File tree 1 file changed +14
-23
lines changed
1 file changed +14
-23
lines changed Original file line number Diff line number Diff line change 1
- import unittest
1
+ import pytest
2
2
3
3
from citylex import xsampa
4
4
5
5
6
- class XSAMPATest (unittest .TestCase ):
7
- def test_a (self ):
8
- self .assertEqual (xsampa .ipa_to_xsampa ("ɑː" ), "A:" )
9
-
10
- def test_ch (self ):
11
- self .assertEqual (xsampa .ipa_to_xsampa ("t͡ʃ" ), "tS" )
12
-
13
- def test_syllabic_m (self ):
14
- self .assertEqual (xsampa .ipa_to_xsampa ("m̩" ), "m_=" )
15
-
16
- def test_schwa (self ):
17
- self .assertEqual (xsampa .ipa_to_xsampa ("ɘ" ), "@\\ " )
18
-
19
- def test_y (self ):
20
- self .assertEqual (xsampa .ipa_to_xsampa ("ʏ" ), "Y" )
21
-
22
- def test_spaces (self ):
23
- self .assertEqual (xsampa .ipa_to_xsampa ("t͡ʃ ɾ" ), "tS 4" )
24
-
25
-
26
- if __name__ == "__main__" :
27
- unittest .main ()
6
+ @pytest .mark .parametrize (
7
+ "source,expected" ,
8
+ [
9
+ ("ɑː" , "A:" ),
10
+ ("t͡ʃ" , "tS" ),
11
+ ("m̩" , "m_=" ),
12
+ ("ɘ" , "@\\ " ),
13
+ ("ʏ" , "Y" ),
14
+ ("t͡ʃ ɾ" , "tS 4" ),
15
+ ],
16
+ )
17
+ def test_ipa_to_xsampa (source , expected ):
18
+ assert xsampa .ipa_to_xsampa (source ) == expected
You can’t perform that action at this time.
0 commit comments