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

Unexpected exceptions raised in main call may exposed TESTed internals #542

Open
pdawyndt opened this issue Sep 25, 2024 · 1 comment
Open

Comments

@pdawyndt
Copy link
Contributor

This test suite should check if a call to the function generate_division_by_zero raises a ZeroDivisionError.

- statement: 'generate_division_by_zero()'
  exception:
    message: "division by zero"
    types:
      python: ZeroDivisionError

However, if the following solution is submitted

print(1/0)

The stack trace exposes some of the TESTed internals that should remain hidden for students:

image

@pdawyndt
Copy link
Contributor Author

pdawyndt commented Oct 3, 2024

I guess we just forgot to clean the stack trace of the main call, because what happens above is as expected (test plan first executed main call and then calls a function, but the main call throws an exception that is displayed by the Python runtime on stderr, and exits, probably with a non-zero exit status that is not shown here). So all we should do is hide the execution_0.puy lines in the stack trace.

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

No branches or pull requests

1 participant