classification
Title: test_descr.py converted to unittest
Type: Stage:
Components: Tests Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, brett.cannon, georg.brandl
Priority: normal Keywords: patch

Created on 2008-01-25 23:27 by amaury.forgeotdarc, last changed 2008-02-02 10:18 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
test_descr.py amaury.forgeotdarc, 2008-01-25 23:31 modified from trunk, rev 60301
test_descr.py amaury.forgeotdarc, 2008-01-26 00:49 py3k version, modified from r60302
Messages (8)
msg61696 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-01-25 23:27
This is test_descr.py converted to unittest. The diff is so large that
svn diff failed!
"svn: Can't write to stream: Not enough space to process this command."
Anyway, I started from trunk, rev 60301.

The file is very large, and some functions have more than 400 lines. I
tried to group them into classes, most of the time respecting the
initial sequential order, but not always.
The class and function names may seem arbitrary sometimes. At least, I
hope that no test was lost in the process. Feel free to reorganize stuff
if you find a logic in all these tests.

I removed all print statements, and converted some statements to
unittest idioms, but not all: lots of "raise TestFailed" remain.

svn merge into py3k will be difficult; I propose to upload a py3k
version of this file, which I will make by merging differences between
trunk and py3k into this new file.
msg61697 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-01-26 00:49
And here is the version for py3k!
I also removed a few duplicate tests or list items, introduced by
unicode->str and long->int conversions.
msg61729 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-01-26 23:02
Just so you know, Amaury, a student did a conversion for GHOP:
http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291
. It was not checked in yet as we are waiting for contributor forms first.

But perhaps you can have a look at it and see if there is anything to
take? I suspect yours is fine (or possibly better since you just have
more experience than a high schooler; no offense, Jeff), but it wouldn't
hurt to have a look and just choose one or the other.
msg61816 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-01-29 11:11
On the contrary, Jeff's version is better in many aspects.
I happily withdraw my submission.

Just a question: why were the docstrings removed?
msg61825 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-01-29 20:12
On Jan 29, 2008 3:11 AM, Amaury Forgeot d'Arc <report@bugs.python.org> wrote:
>
> Amaury Forgeot d'Arc added the comment:
>
> On the contrary, Jeff's version is better in many aspects.
> I happily withdraw my submission.
>
> Just a question: why were the docstrings removed?

Beats me. =) I didn't even notice when I did the initial review.
msg61826 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-01-29 20:24
Did he misunderstand the last comment in this post of yours?
http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291#c24
msg61827 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-01-29 20:52
On Jan 29, 2008 12:24 PM, Amaury Forgeot d'Arc <report@bugs.python.org> wrote:
>
> Amaury Forgeot d'Arc added the comment:
>
> Did he misunderstand the last comment in this post of yours?
> http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291#c24

Ah, I see what you mean.

So docstrings are not used in testing methods because unittest outputs
those as the name of the test and they are not always useful. The
convention is to make them comments instead and let the method test
name be what unittest outputs.
msg61998 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-02-02 10:18
The GHOP patch was now committed as r60521.
History
Date User Action Args
2008-02-02 10:18:52georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
messages: + msg61998
2008-01-29 20:52:24brett.cannonsetmessages: + msg61827
2008-01-29 20:24:24amaury.forgeotdarcsetmessages: + msg61826
2008-01-29 20:12:53brett.cannonsetmessages: + msg61825
2008-01-29 11:11:08amaury.forgeotdarcsetresolution: duplicate
messages: + msg61816
2008-01-26 23:02:00brett.cannonsetnosy: + brett.cannon
messages: + msg61729
2008-01-26 00:49:08amaury.forgeotdarcsetfiles: + test_descr.py
messages: + msg61697
2008-01-25 23:31:16amaury.forgeotdarcsetfiles: + test_descr.py
2008-01-25 23:30:31amaury.forgeotdarcsetfiles: - test_descr.py
2008-01-25 23:27:15amaury.forgeotdarccreate