Ticket #11236 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

trac_11236-test_eq_for_python_2_7-nt.patch Download (3.1 KB) - added by nthiery 2 years ago.

Change History

comment:1 Changed 2 years ago by fbissey

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).

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:4 Changed 2 years ago by fbissey

  • Status changed from needs_review to positive_review

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.

Changed 2 years ago by nthiery

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.

comment:8 Changed 2 years ago by fbissey

  • Status changed from needs_review to positive_review

Ok it worked like a charm. Back to positive review.

comment:9 Changed 2 years ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.7.1.alpha0
Note: See TracTickets for help on using tickets.