============================= test session starts ============================= collecting ... collected 16 items test_vocabulary.py::test_article_level_empty_content PASSED [ 6%] test_vocabulary.py::test_article_level_punctuation_only PASSED [ 12%] test_vocabulary.py::test_article_level_digit_only PASSED [ 18%] test_vocabulary.py::test_article_level_single_word PASSED [ 25%] test_vocabulary.py::test_article_level_subset_vs_superset FAILED [ 31%] test_vocabulary.py:28 (test_article_level_subset_vs_superset) 3 != 3 预期:3 实际:3 <点击以查看差异> def test_article_level_subset_vs_superset(): ''' Boundary case test ''' article1 = ArticleVocabularyLevel('source') article2 = ArticleVocabularyLevel('open source') > assert article1.level < article2.level E assert 3 < 3 E + where 3 = .level E + and 3 = .level test_vocabulary.py:33: AssertionError test_vocabulary.py::test_article_level_multiple_words PASSED [ 37%] test_vocabulary.py::test_article_level_short_paragraph PASSED [ 43%] test_vocabulary.py::test_article_level_medium_paragraph PASSED [ 50%] test_vocabulary.py::test_article_level_long_paragraph PASSED [ 56%] test_vocabulary.py::test_user_level_empty_dictionary PASSED [ 62%] test_vocabulary.py::test_user_level_one_simple_word PASSED [ 68%] test_vocabulary.py::test_user_level_invalid_word PASSED [ 75%] test_vocabulary.py::test_user_level_one_hard_word PASSED [ 81%] test_vocabulary.py::test_user_level_multiple_words PASSED [ 87%] test_vocabulary.py::test_user_level_consider_only_most_recent_words_difficult_words_most_recent PASSED [ 93%] test_vocabulary.py::test_user_level_consider_only_most_recent_words_easy_words_most_recent FAILED [100%] test_vocabulary.py:88 (test_user_level_consider_only_most_recent_words_easy_words_most_recent) 7.761 != 5 预期:5 实际:7.761 <点击以查看差异> def test_user_level_consider_only_most_recent_words_easy_words_most_recent(): ''' Consider only the most recent three words ''' user = UserVocabularyLevel( {'simple':['202408050930'], 'apple': ['202408040000'], 'happy':['202408030000'], 'pasture':['202408020000'], 'putrid':['202408010000'], 'dearth':['202407310000']} ) > assert 4 <= user.level <= 5 E assert 7.761 <= 5 E + where 7.761 = .level test_vocabulary.py:94: AssertionError ======================== 2 failed, 14 passed in 0.18s =========================