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.

classification
Title: test for patch #543865 & others
Type: Stage:
Components: Tests Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: doerwalter Nosy List: brett.cannon, doerwalter, gvanrossum, hfoffani, rhettinger, tim.peters
Priority: normal Keywords: patch

Created on 2002-04-14 22:18 by hfoffani, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_complex_future.py hfoffani, 2002-04-14 22:21 test_complex_future.py
test_complex.py.diff3 hfoffani, 2002-04-14 23:47 cvs diff -c test_complex.py
diff3.txt doerwalter, 2003-07-14 21:08
test_complex_future.py rhettinger, 2003-07-15 06:58 Revised complex future test in unittest format
diff4.txt doerwalter, 2003-07-17 11:25 merge test_complex_future into test_complex
Messages (21)
msg39575 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-14 22:18
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
msg39576 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-14 23:47
Logged In: YES 
user_id=112690


msg39577 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-14 23:48
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
msg39578 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-22 17:51
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.
msg39579 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-22 18:02
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
msg39580 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-22 18:09
Logged In: YES 
user_id=6380

OK, I've deleted them for you. Who do you expect to review
this?
msg39581 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-04-22 18:21
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.
msg39582 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-22 18:31
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.

msg39583 - (view) Author: Hernan Foffani (hfoffani) Date: 2002-04-22 18:38
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.

msg39584 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-06 19:58
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.
msg39585 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-07-14 07:49
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.
msg39586 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-07-14 08:53
Logged In: YES 
user_id=89016

OK, I'll see if I can look at the patches later today.
msg39587 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-07-14 21:08
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.
msg39588 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-07-15 06:16
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.
msg39589 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-07-15 06:58
Logged In: YES 
user_id=80475

Converted test_complex_future.py to unittest format.  See 
attachment.
msg39590 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-07-15 18:58
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
msg39591 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-07-15 21:11
Logged In: YES 
user_id=80475

That's a much better plan.
msg39592 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-07-17 11:25
Logged In: YES 
user_id=89016

OK here is a patch (diff4.txt) that merges
test_complex_future.py into test_complex.py.
msg39593 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-07-18 02:42
Logged In: YES 
user_id=80475

Since __floordiv__ is deprecated for complex, it should be 
left out of the test.  Otherwise, it is ready to load.  

Because they've already tagged the Py2.3 release candidate, 
am marking this as a Py2.4 addition.
msg39594 - (view) Author: Hernan Foffani (hfoffani) Date: 2003-07-18 08:39
Logged In: YES 
user_id=112690

thank you guys, for taking up these.
sadly, i don't have linux available anymore.
i must tell you that the patch was the result of a self-
excercise to learn about CPython. don't be surprise if you 
don't see mayor improvements in code coverage percentages. 
at the time I was very happy if I saw just 1 new LOC on a 
branch tested: it meant that I understood Python's internals 
involved.
sorry for the trouble.
regards,
-hernan
msg39595 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-08-05 16:01
Logged In: YES 
user_id=89016

Checked in as:
Lib/test/test_complex.py 1.13+1.14
and
Lib/test/test_complex.py 1.12.6.1
History
Date User Action Args
2022-04-10 16:05:13adminsetgithub: 36434
2002-04-14 22:18:13hfoffanicreate