Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning state pollution of global variable arguments by assigning with None #20

Merged
merged 1 commit into from May 27, 2022

Conversation

sturmianseq
Copy link
Contributor

This PR aims to improve test reliability of test test_docopt_ng_more_magic_global_arguments_and_dot_access by cleaning state pollution of global variable arguments by assigning with None.

The test can fail in this way by running pip3 install pytest-repeat; python3 -m pytest --count=2 tests/test_docopt_ng.py::test_docopt_ng_more_magic_global_arguments_and_dot_access:

        global arguments
        docopt.docopt(doc, "-v file.py", more_magic=True)
>       assert arguments == {"-v": True, "-q": False, "-r": False, "--help": False, "FILE": "file.py", "INPUT": None, "OUTPUT": None}
E       AssertionError: assert {'--help': Fa...OUTPUT': None} == {'--help': Fa...v': True, ...}
E         Omitting 6 identical items, use -vv to show
E         Left contains 1 more item:
E         {'<FILE>': None}
E         Right contains 1 more item:
E         {'FILE': 'file.py'}

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.

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #20 (b1adf62) into master (de7c861) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #20   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files           1        1           
  Lines         491      491           
=======================================
  Hits          490      490           
  Misses          1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de7c861...b1adf62. Read the comment docs.

@NickCrews NickCrews merged commit ce4ba8e into jazzband:master May 27, 2022
@NickCrews
Copy link
Contributor

Thanks @sturmianseq!! I rebased on master to ensure that CI still passed.

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.

None yet

2 participants