From da2416a1b89450e00841b0e931aaadfcd98a6eff Mon Sep 17 00:00:00 2001 From: Yige Xu Date: Fri, 27 Sep 2019 03:08:29 +0800 Subject: [PATCH] fix test bugs in: 1. use prettytable to print instance; 2. CNXNLI loader and pipe. --- test/core/test_dataset.py | 2 +- test/io/loader/test_matching_loader.py | 2 +- test/io/pipe/test_matching.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/core/test_dataset.py b/test/core/test_dataset.py index 9820eff6..852041f8 100644 --- a/test/core/test_dataset.py +++ b/test/core/test_dataset.py @@ -230,7 +230,7 @@ class TestDataSetIter(unittest.TestCase): ds = DataSet({"x": [[1, 2, 3, 4]] * 10, "y": [[5, 6]] * 10}) for iter in ds: self.assertEqual(iter.__repr__(), """+--------------+--------+ -| x | y | +| x | y | +--------------+--------+ | [1, 2, 3, 4] | [5, 6] | +--------------+--------+""") diff --git a/test/io/loader/test_matching_loader.py b/test/io/loader/test_matching_loader.py index abe21aa9..70367f6d 100644 --- a/test/io/loader/test_matching_loader.py +++ b/test/io/loader/test_matching_loader.py @@ -31,7 +31,7 @@ class TestMatchingLoad(unittest.TestCase): 'MNLI': ('test/data_for_tests/io/MNLI', MNLILoader, (5, 5, 5, 5, 6), True), 'Quora': ('test/data_for_tests/io/Quora', QuoraLoader, (2, 2, 2), False), 'BQCorpus': ('test/data_for_tests/io/BQCorpus', BQCorpusLoader, (5, 5, 5), False), - 'XNLI': ('test/data_for_tests/io/XNLI', CNXNLILoader, (6, 7, 6), False), + 'XNLI': ('test/data_for_tests/io/XNLI', CNXNLILoader, (6, 8, 6), False), 'LCQMC': ('test/data_for_tests/io/LCQMC', LCQMCLoader, (5, 6, 6), False), } for k, v in data_set_dict.items(): diff --git a/test/io/pipe/test_matching.py b/test/io/pipe/test_matching.py index 52d372d5..7e68863d 100644 --- a/test/io/pipe/test_matching.py +++ b/test/io/pipe/test_matching.py @@ -38,7 +38,7 @@ class TestRunMatchingPipe(unittest.TestCase): 'QNLI': ('test/data_for_tests/io/QNLI', QNLIPipe, QNLIBertPipe, (5, 5, 5), (372, 2), True), 'MNLI': ('test/data_for_tests/io/MNLI', MNLIPipe, MNLIBertPipe, (5, 5, 5, 5, 6), (459, 3), True), 'BQCorpus': ('test/data_for_tests/io/BQCorpus', BQCorpusPipe, BQCorpusBertPipe, (5, 5, 5), (32, 2), False), - 'XNLI': ('test/data_for_tests/io/XNLI', CNXNLIPipe, CNXNLIBertPipe, (6, 7, 6), (37, 3), False), + 'XNLI': ('test/data_for_tests/io/XNLI', CNXNLIPipe, CNXNLIBertPipe, (6, 8, 6), (37, 3), False), 'LCQMC': ('test/data_for_tests/io/LCQMC', LCQMCPipe, LCQMCBertPipe, (5, 6, 6), (36, 2), False), } for k, v in data_set_dict.items():