This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年01月28日 19:05 by brett.cannon, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_support.patch | giampaolo.rodola, 2011年01月29日 04:12 | |||
| test_support.patch | giampaolo.rodola, 2011年01月29日 14:41 | |||
| test_support.patch | r.david.murray, 2011年02月23日 04:25 | review | ||
| unnamed | brett.cannon, 2011年07月26日 00:42 | |||
| Messages (30) | |||
|---|---|---|---|
| msg127322 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年01月28日 19:05 | |
It seems a little negligent that test.support has no tests. The test.test_support name is available in py3k and backporting issues to 2.7 shouldn't be a problem (rare chance something does happen it can be handling manually). There doesn't seem to be any reason not to make sure that proper unit testing is being done short of just laziness on our parts. And if this does occur it should probably be listed as an essential test in regrtest. |
|||
| msg127323 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年01月28日 19:06 | |
I should note that I am not suggesting that test.support suddenly be considered a module with a stable API that the public can use. Simply that we take the proper measures to make sure the code in there does what is expected. |
|||
| msg127379 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2011年01月29日 04:12 | |
Attached is a patch which tests about half the API. Certain functions are not documented and/or it's not clear what they do, for others it seems unlikely they are actually used nowadays (although I haven't checked). Also, it probably makes sense to get rid of some functions which look very old or completely useless. |
|||
| msg127381 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年01月29日 04:40 | |
Giampaolo, FYI I'm also working (issue 11015) in parallel on documenting some of the undocumented functions in Doc/library/test.rst that look useful to me. I think we can collaborate here to make sure they're both documented and tested. I'll review your patch P.S. see discussion on pydev about the removal of fcmp |
|||
| msg127383 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年01月29日 05:22 | |
Giampaolo, The patch looks good. Some minor comments below: * class TestCase(unittest.TestCase): -> why not give the test class a more useful name? * import_fresh_module is tested similarly to import_module - can't a test be added that it indeed performs its "special sauce"? * test_DirsOnSysPath: you may want to use assertIn and assertNotIn here. [these were added to Python in 3.1] * test_python_is_optimized: you may want to use assertIsInstance here. |
|||
| msg127407 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2011年01月29日 12:20 | |
test_warnings actually includes sanity checks for import_fresh_module - they could be adapted into a separate unit test easily enough. |
|||
| msg127409 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年01月29日 12:45 | |
+ os.mkdir(os.path.join(TESTFN, TESTFN)) Please don't. This will break the day TESTFN becomes a non-trivial path. + def test_make_bad_fd(self): + fd = support.make_bad_fd() + self.assertRaises(OSError, os.write, fd, b"foo") You should also check that the errno is EBADF. |
|||
| msg127420 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2011年01月29日 14:41 | |
> * class TestCase(unittest.TestCase): -> why not give the test class a > more useful name? done > * import_fresh_module is tested similarly to import_module - can't a > test be added that it indeed performs its "special sauce"? Even by reading the source code I'm not sure what import_fresh_module does exactly. Feel free to write a test for it if you want. > * test_DirsOnSysPath: you may want to use assertIn and assertNotIn here. [these > were added to Python in 3.1] done > * test_python_is_optimized: you may want to use assertIsInstance here. done > + os.mkdir(os.path.join(TESTFN, TESTFN)) > Please don't. This will break the day TESTFN becomes a non-trivial path. done > You should also check that the errno is EBADF. Done. I just hope it's gonna be reliable on all platforms. |
|||
| msg129122 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2011年02月22日 20:27 | |
Can we commit this patch? |
|||
| msg129155 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年02月23日 04:25 | |
I agree that the docs for import_fresh_module are confusing. The code says there are sanity checks in test_heapq and test_warnings, so that code could presumably be used as a model for someone to develop a more complete stand-alone test (I haven't looked for that code myself). I'm not sure why we have both import_fresh_module and CleanImport, since they seem to do similar things (but differently!) I started making comments on other tests and then realized it wasn't much more work to just update them myself. Extended patch attached. |
|||
| msg130651 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年03月12日 02:08 | |
Gah. I always check to see if the patch uploaded before I delete my working copy, but this time I didn't :( :( I guess I'll come back to this during the sprints. |
|||
| msg135260 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年05月06日 05:49 | |
Any news on this? Can you check that your patches apply for latest trunk and commit them? |
|||
| msg140928 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月23日 05:28 | |
Alright, since *some* tests are better than no tests at all, I will try to combine the patches currently attached to the issue, port them to the Hg repo and commit. |
|||
| msg140929 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月23日 05:47 | |
Brett, what do you mean by "listed as an essential test in regrtest". The regrtest.STDTESTS list? |
|||
| msg140930 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月23日 05:51 | |
New changeset be558ad15789 by Eli Bendersky in branch 'default': Issue #11049: adding some tests to test.support http://hg.python.org/cpython/rev/be558ad15789 |
|||
| msg140931 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月23日 05:53 | |
This changeset incorporates Giampaolo's patch with a minor fix in `test.support.python_is_optimized` (which returned '' for False sometimes). |
|||
| msg140934 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年07月23日 06:26 | |
Several buildbot are failing after the commit: ====================================================================== FAIL: test_get_original_stdout (test.test_support.TestSupport) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildslave/3.x.murray-gentoo-wide/build/Lib/test/test_support.py", line 34, in test_get_original_stdout self.assertEqual(support.get_original_stdout(), sys.stdout) AssertionError: <_io.TextIOWrapper name=1 mode='w' encoding='ANSI_X3.4-1968'> != <_io.StringIO object at 0xb715b46c> ---------------------------------------------------------------------- |
|||
| msg140977 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月23日 12:01 | |
New changeset 0018a28583f4 by Eli Bendersky in branch 'default': Issue #11049: skip a test that fails on some buildbots http://hg.python.org/cpython/rev/0018a28583f4 |
|||
| msg140980 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月23日 12:22 | |
OK, the bots are green again after the last push. Sorry about that, folks. I tested this on two different machines (Ubuntu & Win XP) before pushing the original commit. |
|||
| msg141132 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年07月26日 00:42 | |
On Fri, Jul 22, 2011 at 22:47, Eli Bendersky <report@bugs.python.org> wrote: > > Eli Bendersky <eliben@gmail.com> added the comment: > > Brett, what do you mean by "listed as an essential test in regrtest". The > regrtest.STDTESTS list? > Yes |
|||
| msg141247 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月27日 17:23 | |
New changeset 0f09b7f90060 by Eli Bendersky in branch 'default': Issue #11049: added test_support to regrtest.STDTESTS list http://hg.python.org/cpython/rev/0f09b7f90060 |
|||
| msg141526 - (view) | Author: Vinay Sajip (vinay.sajip) * (Python committer) | Date: 2011年08月01日 18:48 | |
test_support fails in my environment, only when run from an installed Python, due to permissions issues: ====================================================================== ERROR: test_forget (test.test_support.TestSupport) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.3/test/test_support.py", line 59, in test_forget support.forget("smtplib") File "/usr/local/lib/python3.3/test/support.py", line 248, in forget unlink(imp.cache_from_source(source, debug_override=True)) File "/usr/local/lib/python3.3/test/support.py", line 205, in unlink os.unlink(filename) OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/__pycache__/smtplib.cpython-33.pyc' The issue is similar to #12331, which was recently fixed. |
|||
| msg141544 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年08月02日 03:27 | |
New changeset 1a978892a105 by Eli Bendersky in branch 'default': Issue #11049: fix test_forget to work on installed Python, by using a temporary module for import/forget http://hg.python.org/cpython/rev/1a978892a105 |
|||
| msg141584 - (view) | Author: Vinay Sajip (vinay.sajip) * (Python committer) | Date: 2011年08月02日 22:36 | |
test_forget still doesn't work using my installed Python: test test_support failed -- Traceback (most recent call last): File "/usr/local/lib/python3.3/test/test_support.py", line 62, in test_forget mod = __import__(TESTFN) ImportError: No module named '@test_20485_tmp' |
|||
| msg141593 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年08月03日 02:21 | |
New changeset 07d94cf3521e by Eli Bendersky in branch 'default': Issue #11049: fix test_forget on installed Python - add os.curdir to sys.path http://hg.python.org/cpython/rev/07d94cf3521e |
|||
| msg141594 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年08月03日 02:22 | |
Vinay, I can't reproduce your problem here (tried installing Python and running from there), but I suspect it's a sys.path issue (you don't have os.curdir on it, I do). Please let me know if it works now. |
|||
| msg141607 - (view) | Author: Vinay Sajip (vinay.sajip) * (Python committer) | Date: 2011年08月03日 11:54 | |
Eli, test_support is now completing on my system without errors. |
|||
| msg141608 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年08月03日 12:06 | |
Vinay, great news. Thanks. |
|||
| msg180609 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年01月25日 19:21 | |
Can this be closed, David? |
|||
| msg180620 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2013年01月25日 20:09 | |
Sure. It doesn't seem likely that I'll get back to it any time soon, and if I do I can open a new issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:12 | admin | set | github: 55258 |
| 2013年01月25日 20:09:50 | r.david.murray | set | status: open -> closed messages: + msg180620 stage: patch review -> resolved |
| 2013年01月25日 19:21:51 | brett.cannon | set | status: pending -> open nosy: - brett.cannon |
| 2013年01月25日 19:21:38 | brett.cannon | set | status: open -> pending nosy: brett.cannon, vinay.sajip, ncoghlan, pitrou, giampaolo.rodola, ezio.melotti, eric.araujo, r.david.murray, eli.bendersky, sandro.tosi, python-dev messages: + msg180609 |
| 2011年08月03日 12:06:47 | eli.bendersky | set | messages: + msg141608 |
| 2011年08月03日 11:54:09 | vinay.sajip | set | messages: + msg141607 |
| 2011年08月03日 02:22:41 | eli.bendersky | set | messages: + msg141594 |
| 2011年08月03日 02:21:42 | python-dev | set | messages: + msg141593 |
| 2011年08月02日 22:36:16 | vinay.sajip | set | messages: + msg141584 |
| 2011年08月02日 03:27:27 | python-dev | set | messages: + msg141544 |
| 2011年08月01日 18:48:11 | vinay.sajip | set | nosy:
+ vinay.sajip messages: + msg141526 |
| 2011年07月30日 13:48:49 | eric.araujo | set | nosy:
+ eric.araujo |
| 2011年07月27日 17:23:18 | python-dev | set | messages: + msg141247 |
| 2011年07月26日 00:42:40 | brett.cannon | set | files:
+ unnamed messages: + msg141132 |
| 2011年07月23日 12:22:38 | eli.bendersky | set | messages: + msg140980 |
| 2011年07月23日 12:01:05 | python-dev | set | messages: + msg140977 |
| 2011年07月23日 06:26:22 | ezio.melotti | set | messages: + msg140934 |
| 2011年07月23日 05:53:34 | eli.bendersky | set | messages: + msg140931 |
| 2011年07月23日 05:51:40 | python-dev | set | nosy:
+ python-dev messages: + msg140930 |
| 2011年07月23日 05:47:39 | eli.bendersky | set | messages: + msg140929 |
| 2011年07月23日 05:28:47 | eli.bendersky | set | messages: + msg140928 |
| 2011年05月06日 05:49:36 | eli.bendersky | set | messages: + msg135260 |
| 2011年05月04日 19:08:32 | sandro.tosi | set | nosy:
+ sandro.tosi |
| 2011年03月12日 03:28:02 | r.david.murray | set | assignee: r.david.murray nosy: brett.cannon, ncoghlan, pitrou, giampaolo.rodola, ezio.melotti, r.david.murray, eli.bendersky |
| 2011年03月12日 02:08:29 | r.david.murray | set | nosy:
brett.cannon, ncoghlan, pitrou, giampaolo.rodola, ezio.melotti, r.david.murray, eli.bendersky messages: + msg130651 |
| 2011年02月23日 04:25:38 | r.david.murray | set | files:
+ test_support.patch nosy: brett.cannon, ncoghlan, pitrou, giampaolo.rodola, ezio.melotti, r.david.murray, eli.bendersky messages: + msg129155 |
| 2011年02月22日 20:27:55 | giampaolo.rodola | set | nosy:
brett.cannon, ncoghlan, pitrou, giampaolo.rodola, ezio.melotti, r.david.murray, eli.bendersky messages: + msg129122 |
| 2011年02月01日 17:05:48 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2011年01月29日 14:41:03 | giampaolo.rodola | set | files:
+ test_support.patch nosy: brett.cannon, ncoghlan, pitrou, giampaolo.rodola, r.david.murray, eli.bendersky messages: + msg127420 |
| 2011年01月29日 12:45:53 | pitrou | set | nosy:
+ pitrou messages: + msg127409 |
| 2011年01月29日 12:20:58 | ncoghlan | set | nosy:
brett.cannon, ncoghlan, giampaolo.rodola, r.david.murray, eli.bendersky messages: + msg127407 |
| 2011年01月29日 05:22:07 | eli.bendersky | set | nosy:
brett.cannon, ncoghlan, giampaolo.rodola, r.david.murray, eli.bendersky messages: + msg127383 |
| 2011年01月29日 04:43:23 | eli.bendersky | set | nosy:
brett.cannon, ncoghlan, giampaolo.rodola, r.david.murray, eli.bendersky type: behavior stage: needs patch -> patch review |
| 2011年01月29日 04:42:59 | eli.bendersky | set | nosy:
+ ncoghlan |
| 2011年01月29日 04:40:54 | eli.bendersky | set | nosy:
+ eli.bendersky messages: + msg127381 |
| 2011年01月29日 04:12:17 | giampaolo.rodola | set | files:
+ test_support.patch nosy: + giampaolo.rodola messages: + msg127379 keywords: + patch |
| 2011年01月28日 19:06:11 | brett.cannon | set | messages: + msg127323 |
| 2011年01月28日 19:05:31 | brett.cannon | create | |