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

trio_test_case: Merge internal version #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

geofft
Copy link
Contributor

@geofft geofft commented Feb 4, 2022

This is mostly for discussion - this is our internal version of
trio_test_case with various bells and whistles. I've lightly merged it
to keep doctrings. The changes from the internal version are

  • don't configure logging automatically
  • unconditionally log around asyncSetUp/asyncTearDown (at INFO level,
    which lines up well with leaving logging unconfigured by default)
    instead of making it conditional on running in our CI

catern and others added 4 commits February 3, 2022 22:28
Basically I think Thread is too confusing.  Process isn't perfect, but
I think it's better.
This is mostly for discussion - this is our internal version of
trio_test_case with various bells and whistles. I've lightly merged it
to keep doctrings. The changes from the internal version are
- don't configure logging automatically
- unconditionally log around asyncSetUp/asyncTearDown (at INFO level,
  which lines up well with leaving logging unconfigured by default)
  instead of making it conditional on running in our CI
@catern
Copy link
Owner

catern commented Feb 7, 2022

See https://github.com/catern/rsyscall/commits/trio-test-case for my revised merge of this. The main thing is simplifying the warnings throwing thing - I think now it's in a nicely upstreamable state (i.e. to unittest.TestCase) while still achieving everything that the colored log messages achieved.

  • I wonder if the SUSPEND_ON_FAILURE behavior is better as part of the test runner? pytest has --pdb to do this; the issue is that pdb isn't an async REPL, but AIUI no-one is using that behavior of wish in SUSPEND_ON_FAILURE right now anyway...

Also, the top answer here is amusing... https://stackoverflow.com/questions/4398967/python-unit-testing-automatically-running-the-debugger-when-a-test-fails

  • Seems like logger.debug would be more appropriate than logger.info?
  • Maybe there's a better way to do install_handler these days?

I'd be happy pushing this now, or waiting if we want to look at it more.

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