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 unittest-based tests #74

Open
njsmith opened this issue Jan 6, 2019 · 3 comments
Open

Handle unittest-based tests #74

njsmith opened this issue Jan 6, 2019 · 3 comments

Comments

@njsmith
Copy link
Member

njsmith commented Jan 6, 2019

As discussed here: python-trio/trio#838
Pytest has support for running unittest-based tests. But, if you try to combine pytest, pytest-trio, and a unittest.TestCase with an async test method, it doesn't work – somehow pytest-trio can't "see through" whatever the TestCase is doing. It would be kinda nice if it did work.

I don't know how urgent this is. Possibly not very. But since we did run into it and do some research, I figured I should write that down.

If this affects you then commenting here would be helpful to let us know.

@catern
Copy link

catern commented Sep 6, 2020

I use unittest with trio, and don't plan to ever migrate to pytest. It would be nice to be able to get rid of my homegrown TrioTestCase in favor of pytest-trio or something else.

@njsmith
Copy link
Member Author

njsmith commented Sep 7, 2020

@catern can you explain more what you mean about not wanting to switch to pytest, but wanting to use pytest-trio? What parts of pytest are you trying to avoid?

@catern
Copy link

catern commented Sep 7, 2020

The test definition part - the part that allows defining tests as free functions, supplying mocks, and using assert. But I'm fine with using the pytest runner to run my tests defined with unittest, if that's the upstream-supported way to use unittest.

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

2 participants