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

ENH: add no-capture option to runtests to allow debugging srctree tests #2701

Merged
merged 2 commits into from Nov 18, 2018

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Nov 6, 2018

When running srctree tests, they run under a separate process. It is sometimes convenient to add a import pdb;pdb.set_trace() breakpoint inside one of these tests to debug what is going on, but the test runner captures stdout and stderr so the interactive prompt is swallowed. Add a no-capture option to runtests to allow the subtree tests to run without capturing stdout, stderr.

If capturing is off, also increase the time_stamper_thread interval to prevent printing logging messages while debugging.

Copy link
Contributor

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

Thanks. Just some minor comments.

runtests.py Outdated
@@ -2118,6 +2132,9 @@ def main():
if options.xml_output_dir:
shutil.rmtree(options.xml_output_dir, ignore_errors=True)

interval = 10
if not options.capture:
interval = 10000
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps set this to None and modify time_stamper_thread to return an empty context in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

runtests.py Outdated
@@ -2118,6 +2132,9 @@ def main():
if options.xml_output_dir:
shutil.rmtree(options.xml_output_dir, ignore_errors=True)

interval = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

Style nit: it'd be cleaner to not re-assign (and perhaps name this something less generic).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@mattip
Copy link
Contributor Author

mattip commented Nov 6, 2018

also added to CHANGES.rst

@scoder
Copy link
Contributor

scoder commented Nov 18, 2018

Thanks!

@scoder scoder added this to the 3.0 milestone Nov 18, 2018
@scoder scoder merged commit 08faa33 into cython:master Nov 18, 2018
@mattip mattip deleted the no-capture-option branch May 30, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants