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

Compilation error message fix for local variable name that is also FieldSet constant #1552

Merged

Conversation

erikvansebille
Copy link
Member

Fixing the compilation error message when a local Kernel variable has same name as a FieldSet constant

This fixes #1512

@@ -186,6 +187,31 @@ def kernel_pnum(particle, fieldset, time):
assert error_thrown


def test_varname_as_fieldname():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use pytest.raises(Exception). It is a much easier way to test that the code raise exception.

See also: https://stackoverflow.com/questions/23337471/how-do-i-properly-assert-that-an-exception-gets-raised-in-pytest

@erikvansebille erikvansebille merged commit a8aeca8 into master May 1, 2024
10 checks passed
@erikvansebille erikvansebille deleted the fix_variabele_as_fieldset_constant_errormessage branch May 1, 2024 05:52
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.

Confusing compilation error message when variable in Kernel has same name as FieldSet constant
2 participants