Fix broken unit test locally.
# LICENSE file in the root directory of this source tree.
from parlai.core.build_data import modelzoo_path
from parlai.core.dict import find_ngrams
+from parlai.core.params import ParlaiParser
import parlai.core.testing_utils as testing_utils
import os
import shutil
@@ -68,11 +69,7 @@ class TestDictionary(unittest.TestCase):
appropriate error.
"""
# Download model, move to a new location
- datapath = os.path.join(
- (os.path.dirname(os.path.dirname(os.path.dirname(
- os.path.realpath(__file__))))),
- 'ParlAI/data',
- )
+ datapath = ParlaiParser().parse_args(print_args=False)['datapath']
try:
# remove unittest models if there before
shutil.rmtree(os.path.join(datapath, 'models/unittest'))
