Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Handle output in stderr gracefully when discovering tests #6

Merged
merged 6 commits into from
Jul 9, 2013
Merged

Handle output in stderr gracefully when discovering tests #6

merged 6 commits into from
Jul 9, 2013

Conversation

roadsideseb
Copy link

Discovering tests did fail as soon as there is output in stderr during the discovery process. This happened even when the output is just a INFO level log. To prevent this from happening, I have changed the Project model to collect the errors and only raise an exception if no test can be found and there are errors in stderr. Otherwise, stderr will be displayed in a stack trace dialog but allow to continue with the discovered tests.

I added a few tests for the discovery message. I am not quite sure about the format or your preference, so please let me know if there's anything that need to be changed. Also, I am not sure if the requirements_test.txt is the right way to deal with test-only dependencies. How do you want to handle that?

@roadsideseb
Copy link
Author

I've update the PR according to your feedback after a rebase from master. Would you mind taking another look?

@@ -23,6 +24,11 @@ def main():
if dialog.status == dialog.CANCEL:
sys.exit(1)

if project.errors:
dialog = IgnorableTestLoadErrorDialog(root, project.render_errors())
Copy link
Member

Choose a reason for hiding this comment

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

render_errors() has been removed, so this needs to be cleaned up.

trace,
button_text='Retry',
cancel_text='Quit',
)

def cancel(self, event=None):
self.parent.destroy()
Copy link
Member

Choose a reason for hiding this comment

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

Good catch noticing this one; see FailedTestDialog for what the implementation should be.

@roadsideseb
Copy link
Author

I've updated the PR to reflect your feedback. It now has support for unittest2 for python < 2.7 through the cricket.compat module. It also contains the requested fixes.

freakboy3742 added a commit that referenced this pull request Jul 9, 2013
Handle output in stderr gracefully when discovering tests
@freakboy3742 freakboy3742 merged commit c80aa2c into beeware:master Jul 9, 2013
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