Fix failing test when running from cli in debug mode#822
Open
Curtis-Barnhart wants to merge 3 commits intobitwes:mainfrom
Open
Fix failing test when running from cli in debug mode#822Curtis-Barnhart wants to merge 3 commits intobitwes:mainfrom
Curtis-Barnhart wants to merge 3 commits intobitwes:mainfrom
Conversation
Owner
|
That is odd. The only thing I can think of is that maybe the editor version is disabling warnings that the command line is not, and some of the warnings are only visible when the debugger is active? That doesn't really seem right though. I'm fine with this change but I don't want to merge it until I understand what is going on with the warnings. I'll keep my eyes open and look into this a bit more when I get a chance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are many places in GUT where unused parameters are not prefixed with underscores. I didn't think this was really a big problem, but I ran into one quite unexpected error because of it. When I ran this GUT unit test, with debug mode on from the cli, it actually caused the test to fail, which I do not believe should happen:
Command:
godot -d -s addons/gut/gut_cmdln.gd -- -gconfig= -gtest=./test/unit/test_gut.gd -gunit_test_name=test_can_run_tests_with_parametersError:
Running this test from the gui was fine, as well as running it without the
-dflag, but for some reason running it in debug mode caused an actual failure. I don't understand exactly why this occurs and I'd love to learn more (any ideas?), but regardless it didn't seem like a bad idea to me to change some of the unused parameters to start with underscores. This removes the error and also cleans up a lot of extra warning noise that the unused parameters were generating.There were also two variables in test_gut.gd that I believe were genuinely not used for anything and could be removed, but it would be good to check that my understanding here is actually correct.
There are possibly many other places with unused parameter warnings that I did not change in this pr - I only changed these particular ones because they were actually causing errors or were in the same file/related files to the ones that were causing errors.