[Patches] [ python-Patches-543867 ] test for patch #543865 & others
SourceForge.net
noreply@sourceforge.net
Thu, 17 Jul 2003 04:25:16 -0700
Patches item #543867, was opened at 2002-04-15 00:18
Message generated for change (Comment added) made by doerwalter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=543867&group_id=5470
Category: Tests
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Hernan Martinez Foffani (hfoffani)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: test for patch #543865 & others
Initial Comment:
Here are 3 patches for:
- test_complex.py:
. add several checks to force execution of
unvisited
parts of complexobject.c code.
. add a test for complex floor division corresponding
bug #543387 and fix #543865
- test_complex_future.py
. add test for "future" true division.
(actually this is not a patch but the hole file)
- test_b1.py
. add test for bug #543840 and it's fix at patch
#543865
Regards,
-Hernan
----------------------------------------------------------------------
>Comment By: Walter Dörwald (doerwalter)
Date: 2003-07-17 13:25
Message:
Logged In: YES
user_id=89016
OK here is a patch (diff4.txt) that merges
test_complex_future.py into test_complex.py.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-15 23:11
Message:
Logged In: YES
user_id=80475
That's a much better plan.
----------------------------------------------------------------------
Comment By: Walter Dörwald (doerwalter)
Date: 2003-07-15 20:58
Message:
Logged In: YES
user_id=89016
test_complex.py is checked in as rev 1.12.
test_complex_future.py looks good, although I don't exactly
understand its purpose, as there are tests from true
division and floor division in test_complex.py already. We
could extend check_div() in test_complex.py to try both
__truediv__ and __floordiv__. This would IMHO be better than
the code duplication in test_complex_future.py
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-15 08:58
Message:
Logged In: YES
user_id=80475
Converted test_complex_future.py to unittest format. See
attachment.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-15 08:16
Message:
Logged In: YES
user_id=80475
diff3.txt looks good and runs fine on my machine. I'm
surprised that it did not increase code coverage. The
comparisons of a ** 105 to itself should be commented as a
whitebox test of a special case code path.
----------------------------------------------------------------------
Comment By: Walter Dörwald (doerwalter)
Date: 2003-07-14 23:08
Message:
Logged In: YES
user_id=89016
Reworking test_complex.py.diff3 into the attached diff3.txt
I don't see any increase in code coverage for
complexobject.c (it stays at 91.84%) except for the file
writing test which brings the coverage up to 92.95%. The
current tests in test_complex.py seem to cover most test
cases from test_complex.py.diff3 (except that
test_complex.py.diff3 uses ** and % and the current
test_complex.py uses pow and __mod__). So I'd say we add the
file writing test and drop the rest.
I'll look at test_complex_future.py tomorrow.
----------------------------------------------------------------------
Comment By: Walter Dörwald (doerwalter)
Date: 2003-07-14 10:53
Message:
Logged In: YES
user_id=89016
OK, I'll see if I can look at the patches later today.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-14 09:49
Message:
Logged In: YES
user_id=80475
Walter, do you care to add these in unittest form?
Also, since the tests are to validate bug fixes, they are
appropriate to go into Py2.3.
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2003-07-06 21:58
Message:
Logged In: YES
user_id=357491
The patch is now severely outdated since test_complex.py has
been converted to PyUnit, but it might be pertinent to go through
the patch and see if any tests are there that could be added.
----------------------------------------------------------------------
Comment By: Hernan Martinez Foffani (hfoffani)
Date: 2002-04-22 20:38
Message:
Logged In: YES
user_id=112690
Regarding "the error msg for complex pow says "remainder";
it shouldn't" you are correct, the exception string has a
bad wording.
----------------------------------------------------------------------
Comment By: Hernan Martinez Foffani (hfoffani)
Date: 2002-04-22 20:31
Message:
Logged In: YES
user_id=112690
On:
vereq(a ** 105, a ** 105) ... etc ...
The c code in complexobject.c has special cases when the
exponent is > 100, < than -100, and in-between.
I didn't want to test for equality with constants to avoid
messing up with floating point issues.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2002-04-22 20:21
Message:
Logged In: YES
user_id=31435
I'm not sure what lines like
vereq(a ** 105, a ** 105)
vereq(b ** -105, b ** -105)
vereq(b ** -30, b ** -30)
are trying to test. That we get the same answer when we do
exactly the same thing twice?
Note that complex % has been deprecated: no point adding a
test for a deprecated feature.
The error msg for complex pow says "remainder"; it
shouldn't.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-04-22 20:09
Message:
Logged In: YES
user_id=6380
OK, I've deleted them for you. Who do you expect to review
this?
----------------------------------------------------------------------
Comment By: Hernan Martinez Foffani (hfoffani)
Date: 2002-04-22 20:02
Message:
Logged In: YES
user_id=112690
Yes to both questions. I'm withdrawing test_complex.py
and test_b1.py.
I can't delete them and I double checked that I were
correctly logged in as hfoffani.
SourceForge error:
File Delete: ArtifactFile: Permission Denied
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-04-22 19:51
Message:
Logged In: YES
user_id=6380
I don't understand your comment. Are you withdrawing the
files test_complex.py and test_b1.py? Have you uploaded
these to separate patch issues? You should be able to delete
them as the original submitter; ifthis doesn't work, let me
know and I'll do it.
----------------------------------------------------------------------
Comment By: Hernan Martinez Foffani (hfoffani)
Date: 2002-04-15 01:48
Message:
Logged In: YES
user_id=112690
Following Tim's advise to group together bug/fix/test, I'll
leave this patch entry for improvements in the tests of
complex numbers.
Then the valid files are:
21173: test_complex_future.py
and
21180: test_complex.diff3
----------------------------------------------------------------------
Comment By: Hernan Martinez Foffani (hfoffani)
Date: 2002-04-15 01:47
Message:
Logged In: YES
user_id=112690
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=543867&group_id=5470