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
Additional Flag For Unit-Test Module: There Can Be Only One (Error) #46494
Comments
The attached diff adds a "-o" ("--one") option to the "unittest" module |
Hi Brian; The module is intended for test suites where the unit tests are written When tests are written like that, you can interrupt a bulk test run at Given your test suite, I can see how this '--one' option is helpful to unittest.main(testRunner=MyCustomTestRunner()) (BTW, regarding the implementation, it's not ideal to pass the 'onlyOne' Best wishes, -Steve |
Actually, py.test and nose both have the -x option for this purpose. Even while developing on core python, this option would have helped me a |
I guess I don't completely agree with the rationale, because I've never However, this isn't a big issue for me, and if someone's willing to |
Having tests run independently of each other is not the same as having If one function under test calls another function that is also tested, To make things easier, I simply name my tests such that lower-level The point of the "--one" option is just to have it stop when the first As for the method of implementation, I'm sure there are better ways to I'll let somebody else actually re-open this issue if it's a desired Thanks! |
Hi Brian - thanks for going into some details of your rationale! You might be surprised to hear that it's indeed possible to make all of In most real-world cases, though, a class under test will be tested Of course, it often makes sense to have separate test suites for As for preparing an updated patch, I'll get to it if I get a few All the best from this Brit in Germany. |
I am somewhat new to mock objects. I'm coding up my first one now (in Even within a single module, I typically have many tests for the methods Anyway, this is something that works for me, but I understand that not All the best from this Canadian in Switzerland. :-) |
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: