Ticket #11236 (closed defect: fixed)
Fix _test_eq for Python 2.7
| Reported by: | nthiery | Owned by: | mvngu |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.7.1 |
| Component: | doctest coverage | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | François Bissey |
| Authors: | Nicolas M. Thiéry | Merged in: | sage-4.7.1.alpha0 |
| Dependencies: | Stopgaps: |
Description
In Python 2.7, AssertEqual? / AssertNonEqual? call directly == and != a bit differently. So in Parent._test_eq, one is better of calling explicitly != and ==.
Attachments
Change History
comment:2 Changed 2 years ago by fbissey
sage -t -long -force_lib "devel/sage-main/sage/structure/parent.pyx"
[21.7 s]
----------------------------------------------------------------------
All tests passed!
sage-on-gentoo 4.7.alpha5 with python-2.7.1. vanilla sage coming.
comment:3 Changed 2 years ago by fbissey
- Status changed from new to needs_review
Tested on vanilla sage (4.7.alpha1) and tests passed. Positive review from me.
comment:5 follow-up: ↓ 6 Changed 2 years ago by fbissey
- Status changed from positive_review to needs_work
Sorry not in my initial post because I missed it but sage/structure/element.pyx has exactly the same test and problem. I don't think there are any other instance but I'll check again. It looks so much the same that you would think the patch for parent.pyx would just apply with some fuzz.
comment:6 in reply to: ↑ 5 Changed 2 years ago by nthiery
- Status changed from needs_work to needs_review
Replying to fbissey:
Sorry not in my initial post because I missed it but sage/structure/element.pyx has exactly the same test and problem. I don't think there are any other instance but I'll check again. It looks so much the same that you would think the patch for parent.pyx would just apply with some fuzz.
Voilà!
So much for me not finding a way to avoid the code duplication between Parent and Element :-)
comment:7 Changed 2 years ago by fbissey
That's great! It's a bit late in the day for me to test it but we'll probably be back at positive review tomorrow.


I am doing a build of python-2.7 sage-4.7.alpha5 right now. I assume you tested that it was safe with python-2.6 (I will run a check on a vanilla install in any case).