[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 436972e295f5057fe7cdd7312f543c2fa884705d by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-19950: Clarify unittest TestCase instance use. (GH-6875) (GH-6938)

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset a5f33a899f6450de96f5e4cd154de4486d50bdd7 by Gregory P. Smith (Miss Islington (bot)) in branch '3.6': bpo-19950: Clarify unittest TestCase instance use. (GH-6875) (GH-6939)

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6608 ___ Python tracker ___

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset dff46758f267ad6c13096c69c4e1dee17f9969aa by Gregory P. Smith in branch 'master': bpo-19950: Clarify unittest TestCase instance use. (GH-6875) https://github.com/python/cpython/commit/dff46758f267ad6c13096c69c4e1dee17f9969aa

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6609 ___ Python tracker ___

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +6548 stage: needs patch -> patch review ___ Python tracker ___

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-04-25 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +easy -patch stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4 ___ Python tracker

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2014-04-27 Thread Claudiu.Popa
Claudiu.Popa added the comment: In Python 3 docs there is a hint in the documentation for `loadTestsFromModule`: This method searches module for classes derived from TestCase and creates an instance of the class for each test method defined for the class. The phrase with a fixture per test

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2014-02-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19950 ___ ___

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-11 Thread Claudiu.Popa
Claudiu.Popa added the comment: How about the following: Each instance of the TestCase will only be used to run a single test method from it, so a new instance is created for each test method. It replaces `fixture` with `instance` and it emphasizes that the called method belongs to that

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-10 Thread Claudiu.Popa
New submission from Claudiu.Popa: I was surprised that in the following __init__ is actually called once per test function, although nothing in documentation implied so. a.py -- import unittest class A(unittest.TestCase): def __init__(self, *args, **kwargs): print('called only

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-10 Thread R. David Murray
R. David Murray added the comment: I'm guessing it is that a new TestCase instance is instantiated each time an individual test is run. I don't know that this is part of the API, though, so I'm not sure how it should be documented. -- nosy: +r.david.murray

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-10 Thread Ned Batchelder
Ned Batchelder added the comment: This sentence seems to cover it: Each instance of the TestCase will only be used to run a single test method, so a new fixture is created for each test. from http://docs.python.org/2/library/unittest.html The word fixture here is being used oddly, but that's

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-10 Thread Claudiu.Popa
Claudiu.Popa added the comment: Each instance of the TestCase will only be used to run a single test method, so a new fixture is created for each test. Yes, this seems to be, but it is not clear what fixture means in this context (as in the preparation needed to perform one or *more* tests?).

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2013-12-10 Thread Michael Foord
Michael Foord added the comment: I'd be happy with a doc change from fixture to instance (or maybe add instance in parentheses). I'd rather a simple change than making the documentation much longer. The reason for a separate instance per test is for test isolation. Each test can create and