Skip to content

Commit

Permalink
remove temp_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MXueguang committed May 3, 2021
1 parent 86f4e70 commit b466646
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_load_qrels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

import os
import shutil
import unittest

from pyserini import search
Expand All @@ -26,6 +27,9 @@ def read_file_lines(path):

class TestGetQrels(unittest.TestCase):

def setUp(self):
os.environ['PYSERINI_CACHE'] = 'temp_dir'

def test_robust04(self):
qrels_path = search.get_qrels_file('robust04')
lines = read_file_lines(qrels_path)
Expand Down Expand Up @@ -247,6 +251,10 @@ def test_trec2019_bl(self):
self.assertEqual(mid_line, "853 0 2444d88d62539b0b88dc919909cb9701 2")
self.assertEqual(last_line, "885 0 fde80cb0-b4f0-11e2-bbf2-a6f9e9d79e19 0")

def tearDown(self):
if os.path.exists('temp_dir'):
shutil.rmtree('temp_dir')


if __name__ == '__main__':
unittest.main()

0 comments on commit b466646

Please sign in to comment.