Skip to content

Removing state pollution in idd_commlst#358

Open
sturmianseq wants to merge 1 commit into
santoshphilip:masterfrom
sturmianseq:fix_test_group2commlst
Open

Removing state pollution in idd_commlst#358
sturmianseq wants to merge 1 commit into
santoshphilip:masterfrom
sturmianseq:fix_test_group2commlst

Conversation

@sturmianseq

Copy link
Copy Markdown

This PR aims to improve test reliability of test test_group2commlst by removing state pollution in idd_commlst by making a deepcopy

The test can fail in this way by running pip3 install pytest-repeat; python3 -m pytest --count=2 $test_path:

        for (groupcommlst,) in data:
            glist = iddgroups.iddtxt2grouplist(iddtxt)
            result = iddgroups.group2commlst(idd_commlst, glist)
>           assert result == groupcommlst
E           AssertionError: assert [[['group Non...t 7.0']], ...] == [[['group Non...t 7.0']], ...]
E             At index 0 diff: [['group None', 'idfobj Lead Input', 'group None', 'idfobj Lead Input']] != [['group None', 'idfobj Lead Input']]
E             Full diff:
E               [
E                [['group None',
E             +    'idfobj Lead Input',
E             +    'group None',
E                  'idfobj Lead Input']],...
E             
E             ...Full output truncated (60 lines hidden), use '-vv' to show

It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant