Opened 10 years ago

Closed 10 years ago

#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: Merged in: sage-4.7.1.alpha0
Authors: Nicolas M. Thiéry Reviewers: François Bissey
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

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 (1)

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

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 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 10 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 10 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 10 years ago by fbissey

  • Status changed from needs_review to positive_review

comment:5 follow-up: Changed 10 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 10 years ago by nthiery

comment:6 in reply to: ↑ 5 Changed 10 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 10 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 10 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 10 years ago by jdemeyer

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