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

Add an indicator to method metadata to indicate static methods #152

Closed
bitwes opened this issue Oct 13, 2019 · 2 comments · Fixed by godotengine/godot#81079
Closed

Add an indicator to method metadata to indicate static methods #152

bitwes opened this issue Oct 13, 2019 · 2 comments · Fixed by godotengine/godot#81079
Milestone

Comments

@bitwes
Copy link

bitwes commented Oct 13, 2019

Describe the project you are working on:
The GUT unit testing framework.

Describe the problem or limitation you are having in your project:
When creating doubles for objects I cannot determine if a method is static or not which causes error when instantiating said object.

Describe how this feature / enhancement will help you overcome this problem or limitation:
I can exclude static methods from doubling.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
In the results of get_method_list the dictionary would include some way to determine if a method is static or not.

Describe implementation detail for your proposal (in code), if possible:
NA

If this enhancement will not be used often, can it be worked around with a few lines of script?:
There is a workaround. Barring any way to determine the status from info provided by the engine, I must make users specify a list of functions not to double. This is more cumbersome for users than it is to code.

Is there a reason why this should be core and not an add-on in the asset library?:
I don't know how an add-on could supply this info. It's also useful information that others may need at some point. Most everything else about the method is provided by get_method_list

@AlexDarigan
Copy link

There is an annotations #20318 issue opened here which if ever implemented should help solve problems like this.

I've ran into the same issue as you with WAT so I've ended up defaulting to a deferred creation of a partial double. Users get a TestDoubleDirector back and then it is up them to short-circuit the methods (director.method("add").stub(null) or in this use case director.method("add", "static").stub(null) and then the method structures are written once the users call var dbl = director.double())

On a related note the addition of annotations means we could possibly do:

@test
method()

which would also be awesome.

@Calinou Calinou changed the title Add an indicator to method meta data to indicate static methods Add an indicator to method metadata to indicate static methods Nov 22, 2020
@raulsntos
Copy link
Member

Was this implemented by godotengine/godot#46378?

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

Successfully merging a pull request may close this issue.

5 participants