[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2017-06-20 Thread Никита Конин
Changes by Никита Конин : -- nosy: +Никита Конин ___ Python tracker ___ ___

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-11-14 Thread Piotr Dobrogost
Piotr Dobrogost added the comment: But I think Piotr's use case is when you download some new library (...) Yes, indeed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16312 ___

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-29 Thread Michael Foord
Michael Foord added the comment: Is this logging specific issue an actual problem or a theoretical problem? It's not a problem I've ever seen (myself), nor the one the issue was opened for. -- ___ Python tracker rep...@bugs.python.org

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-29 Thread Vinay Sajip
Vinay Sajip added the comment: Not an actual problem (for me), and although the issue was opened for more general functionality, logging is the only specific use case that was actually cited. -- ___ Python tracker rep...@bugs.python.org

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-28 Thread Vinay Sajip
Vinay Sajip added the comment: Is there any common use case other than logging? For example, logging could be covered by an additional command-line argument for unittest.main(), e.g. --logconfig /path/to/logging-config.json which would cause unittest.main() to load the JSON in the specified

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-28 Thread Piotr Dobrogost
Piotr Dobrogost added the comment: @Vinay I don't see other use cases but maybe guys behind py.test, where there is such a feature could come up with other use cases. The solution with passing config dict in a new command line parameter seems to be enough as long as logging is concerned.

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-28 Thread Michael Foord
Michael Foord added the comment: I always solve the logging problem with test-development-production configuratins and ensuring that running tests imports the logging setup. I've never wanted / needed to configure logging from the command line. --

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-28 Thread Vinay Sajip
Vinay Sajip added the comment: @Michael: When unit testing one's own projects, I agree with you. But I think Piotr's use case is when you download some new library from PyPI or clone it from GitHub/BitBucket/etc., and you want to run tests on that code without changing any of it, as you're

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-27 Thread Piotr Dobrogost
Piotr Dobrogost added the comment: @Chris The example given by Holger Krekel (http://stackoverflow.com/a/13094042/95735) showing how it can be done with pytest is exactly the thing I had in mind. It would be good to have this feature incorporated into unittest. @Michael I guess checking

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-27 Thread Michael Foord
Michael Foord added the comment: @piotr Yes, protecting the set up with a lock would be easy, although unittest doesn't directly support running tests in parallel anyway. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16312

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-26 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16312 ___ ___

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-26 Thread Chris Jerdonek
Chris Jerdonek added the comment: Can you give an example of what you would like the API to look like (i.e. what you would like to be able to type from the command-line if, say, configuring logging as in the SO post)? I'm not sure I understand why a wrapper script isn't a good enough

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-26 Thread Michael Foord
Michael Foord added the comment: I would do this with a module level (global) flag as to whether the initial set up has been done and a BaseTestCase class that checks this flag and calls a set up function if it hasn't been done yet (and then sets the flag). --

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-26 Thread Michael Foord
Changes by Michael Foord mich...@voidspace.org.uk: -- assignee: - michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16312 ___ ___

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-10-24 Thread Piotr Dobrogost
New submission from Piotr Dobrogost: When running tests bundled with a library it would be useful to be able to run some initialization code before tests are being run so that one can configure options pertaining to logging for example. For this reason it would be useful to have a new command