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

Allow empty program error messages. #61

Merged
merged 2 commits into from
Feb 6, 2023
Merged

Allow empty program error messages. #61

merged 2 commits into from
Feb 6, 2023

Conversation

mzweilin
Copy link
Contributor

@mzweilin mzweilin commented Feb 6, 2023

What does this PR do?

We want pytest to detect non-zero return value of a program and fail a test, but the previous code will ignore the error if the message is empty. The fix allows failing a test with an empty error message.

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • Test A
  • Test B

Before submitting

  • The title is self-explanatory and the description concisely explains the PR
  • My PR does only one thing, instead of bundling different changes together
  • I list all the breaking changes introduced by this pull request
  • I have commented my code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have run pre-commit hooks with pre-commit run -a command without errors

Did you have fun?

Make sure you had fun coding 🙃

@mzweilin mzweilin requested a review from dxoigmn February 6, 2023 19:12
@mzweilin mzweilin self-assigned this Feb 6, 2023
mzweilin added a commit that referenced this pull request Feb 6, 2023
Copy link
Contributor

@dxoigmn dxoigmn left a comment

Choose a reason for hiding this comment

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

LGTM

@mzweilin mzweilin merged commit 4d10cdb into main Feb 6, 2023
@mzweilin mzweilin deleted the program_err_msg branch February 6, 2023 22:01
mzweilin added a commit that referenced this pull request Feb 6, 2023
* Allow --resume without other parameters.

* Add a resume test.

* Make failed experiments capturable.

* Move extra overrides to the pseudo task folder.

* Test if resume happens before modifying configs.

* Capture stdout in test.

* Resume and modify cfg before any other change is made.

* Remove color in console output for testing.

* Make imports consistent.

* Install optinal dependency in CI.

* Replace strip_ansi with _tty_out=False.

* Revert "Replace strip_ansi with _tty_out=False."

This reverts commit 589df6b.

* Avoid parsing program output by disabling timestamp in the output path.

* Switch from MULTIRUN to RUN.

* Return -1 if not runable.

* Allow empty error messages.

* NO_COLOR=1 in terminal output during tests.

* Remove dependency strip_ansi.

* Separate changes to #59.

* Separate changes to #61 and #62.

* Move the code closer.

* Comment.

* Move sys.ext() out of main().

* Remove unused import.
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.

2 participants