Skip to content

fix failing test_optparse.TestValuesDictionary test #704

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

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

Curtis-Barnhart
Copy link
Contributor

@Curtis-Barnhart Curtis-Barnhart commented Apr 18, 2025

In test_optparse.TestValueDictionary.test_values_contains_positional_arguments_default_value, op.parse() is called to see if a positional argument would be filled with its default value when no arguments are given. However, op.parse() is called with no arguments instead of an empty list, which actually passes it arguments passed to the godot process.

Because of this, running the test with godot -d -s addons/gut/gut_cmdln.gd -gtest test/unit/test_optparse.gd (with no .gutconfig.json file) fails with [Failed]: ["test/unit/test_optparse.gd"] expected to equal ["asdf"]:.

By passing it an empty list we ensure it tries to parse no arguments, and the test no longer fails when run with the above command.

…mpty list as an argument to signify no passed arguments
@bitwes
Copy link
Owner

bitwes commented Apr 24, 2025

I saw this fail a couple times when running from the editor and not the command line. Good catch.

@bitwes bitwes merged commit 9fe958a into bitwes:main Apr 24, 2025
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.

2 participants