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

Document using EngineDebugger.is_active() to skip tests #607

Closed
bitwes opened this issue May 15, 2024 · 2 comments
Closed

Document using EngineDebugger.is_active() to skip tests #607

bitwes opened this issue May 15, 2024 · 2 comments

Comments

@bitwes
Copy link
Owner

bitwes commented May 15, 2024

Versions

Godot 4, Godot 3 if EngineDebugger.is_active() or equivalent exists

The Feature

If you have a test that would normally cause the debugger to break on an error, you can skip the test if the debugger is enabled with the following code.

func test_something_when_debugger_disabled():
	if(EngineDebugger.is_active()):
		pending("Test skipped, disable debug to run test")
		return
	...
@bitwes
Copy link
Owner Author

bitwes commented May 15, 2024

I'm not sure if there is a way to run tests through the editor without having debug enabled. The above method works fine when running from the command line/vscode with or without -d flag. Currently GUT uses EditorInterface.play_custom_scene to run tests. This appears to always have the debugger enabled.

@bitwes
Copy link
Owner Author

bitwes commented Jul 26, 2024

This has been documented in the should_skip_script documentation.

@bitwes bitwes closed this as completed Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant