Skip to content

Commit a3f42be

Browse files
committed
Uses the current test dir as data dir.
1 parent 8a8b974 commit a3f42be

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

python/test/sentencepiece_test.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.!
1717

18-
import sys
19-
2018
from collections import defaultdict
2119
import io
2220
import os
2321
import pickle
24-
import unittest
22+
import sys
2523
import threading
24+
import unittest
2625
import sentencepiece as spm
2726

2827
HERE = os.path.dirname(os.path.abspath(__file__))
@@ -31,8 +30,6 @@
3130
print('VERSION={}'.format(spm.__version__))
3231

3332
data_dir = HERE
34-
if sys.platform == 'win32':
35-
data_dir = os.path.join('..', 'data')
3633

3734

3835
class TestSentencepieceProcessor(unittest.TestCase):
@@ -42,9 +39,7 @@ def setUp(self):
4239
self.sp_ = spm.SentencePieceProcessor()
4340
self.jasp_ = spm.SentencePieceProcessor()
4441
self.assertTrue(self.sp_.Load(os.path.join(HERE, 'test_model.model')))
45-
self.assertTrue(
46-
self.jasp_.Load(os.path.join(HERE, 'test_ja_model.model'))
47-
)
42+
self.assertTrue(self.jasp_.Load(os.path.join(HERE, 'test_ja_model.model')))
4843
with open(os.path.join(HERE, 'test_model.model'), 'rb') as f:
4944
self.assertTrue(self.sp_.LoadFromSerializedProto(f.read()))
5045
with open(os.path.join(HERE, 'test_ja_model.model'), 'rb') as f:

0 commit comments

Comments
 (0)