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

Convert the tests to use pytest #123

Closed
cfarrow opened this issue Mar 22, 2017 · 4 comments
Closed

Convert the tests to use pytest #123

cfarrow opened this issue Mar 22, 2017 · 4 comments
Labels
tests enhance or fix tests

Comments

@cfarrow
Copy link
Contributor

cfarrow commented Mar 22, 2017

From the discussion in #121.

@cfarrow
Copy link
Contributor Author

cfarrow commented Mar 22, 2017

I would definitely like to use a more conventional test runner for comtypes, and pytest is the latest and greatest. However, I'd prefer the test code to not depend on pytest, primarily because comtypes does not currently require any external packages to run (most of) the tests. In other words, I think it's best to bring the tests to a state where python -m unittest comtypes works, and then use pytest as a test runner, code coverage, etc.

What do others think?

@orf
Copy link
Contributor

orf commented Mar 22, 2017

One of the best features of pytest is the composability that using fixtures bring as well as nice simple assert x == y syntax. But after looking through the current tests it seems that fixtures won't be too useful, so perhaps just standard unittest tests are fine.

I wouldn't be scared of adding test dependencies though, for example the find_memleak.py could be considerably shorter and more readable if psutil was used.

One last thing, I think it would be good to separate the tests out into two types: automated and manual. For example there should definitely be a test for automating Microsoft Word/Excel as this is one of the main reasons people use comtypes, but running those on the CI server is impossible. However over COM tests like the Internet Explorer ones can be automated for sure, and the manual ones just have to be perhaps run before a release.

@cfarrow
Copy link
Contributor Author

cfarrow commented Mar 27, 2017

+1 for of breaking up the tests cleanly into automated and manual tests. Also for using psutil for the memory leak tests. Those tests are very unreliable.

Ultimately, anything that cleans up the tests and makes them easier to write and maintain is a good thing. pytest is easy to install, so I'm not overly worried about introducing it if we're bringing psutil in as a dependency as well.

@junkmd junkmd added the tests enhance or fix tests label Nov 25, 2022
@junkmd
Copy link
Collaborator

junkmd commented Jun 19, 2023

@cfarrow
@orf

This issue has not been in motion for years.

Time has passed since this issue was submitted, and with contributions to improve the test, including #267, #271 and #298, the situation is much different now than it was then.

There is also a more comprehensive discussion in #480 on whether we should introduce modern tools such as pytest.

So, I will close this issue, and redirect the discussion to #480.

Thank you.

@junkmd junkmd closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests enhance or fix tests
Projects
None yet
Development

No branches or pull requests

3 participants