wikit-ai / olaf

6 stars 1 forks source link

check and validate group_cts_on_synonyms #107

Closed ba-talibe closed 5 months ago

ba-talibe commented 5 months ago

During a review, I had the test `test_group_ct_on_synonyms` that did not pass. But when rerunning the tests again, the test passed. It looks a lot like when I add tests passing randomly based on the order Python chooses to pick the element in the initial set.

Full failed test output:

set_candidates = {<data_container.candidate_term_schema.CandidateTerm object at 0x00000210108B1600>, <data_container.candidate_term_sch... object at 0x00000210108B2680>, <data_container.candidate_term_schema.CandidateTerm object at 0x00000210108B18A0>, ...}

    def test_group_ct_on_synonyms(set_candidates):
        common_groups = group_cts_on_synonyms(set_candidates)
>       assert len(common_groups) == 3
E       assert 4 == 3
E        +  where 4 = len([{<data_container.candidate_term_schema.CandidateTerm object at 0x00000210108B1600>, <data_container.candidate_term_sc...rm object at 0x00000210108B2680>}, {<data_container.candidate_term_schema.CandidateTerm object at 0x00000210108B3130>}])

test\commons\test_candidate_term_tools.py:225: AssertionError