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
Refactor test_threadedtempfile.py to use unittest. #44635
Comments
This patch turns test_threadedtempfile.py into a unittest test file. There should be no changes in what the file tests. Input on this patch is welcome before I go too far on more of the old test files. |
Lib/test/output/test_threadedtempfile should also be removed when this patch is applied. |
Why did you get rid of the -t/-f options? |
I removed the -t/-f options mostly because in the short time I spent trying to handle both -t/-f and unittest.main(), it seemed like the options were messing up unittest. I asked about removing the command line processing on this file at the PyCon sprint and the people there thought it would be okay to remove them. Their argument was that the files that match output to the output/ directory haven't been refactored in a long time, probably aren't maintained much (other than when they break), and probably aren't used much. Since the intended audience of this file is a developer, they wouldn't have a difficult time manually changing the global variables for this setting located at the top of the file. Having said that, if someone uses this functionality, I'll try adding it back in. Thoughts? |
They can stay out; I just wanted to know the reason. This patch looks good to me. |
One question before I apply this: why did you leave if t.error_count:
print '%s errors:\n%s' % (t.getName(), t.errors.getvalue()) in ThreadedTempFileTest.test_main()? Why not make it some kind of assertion? |
File Added: test_threadedtempfile.py.patch |
RE:
I missed that line - removed it and made the final assert more useful. See patch v2. |
I added an assert for 'ok', committed the result as r54295. Thanks for the patch! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: