Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctest failures due to hard-coded line numbers in (doctests of) sage/rings/*.pyx #9859

Closed
nexttime mannequin opened this issue Sep 6, 2010 · 10 comments
Closed

Doctest failures due to hard-coded line numbers in (doctests of) sage/rings/*.pyx #9859

nexttime mannequin opened this issue Sep 6, 2010 · 10 comments

Comments

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 6, 2010

$ ./sage -t  -long devel/sage/sage/rings/integer.pyx
sage -t -long "devel/sage/sage/rings/integer.pyx"           
**********************************************************************
File "devel/sage/sage/rings/integer.pyx", line 4618:
    sage: 5.sqrt_approx(prec=200)
Expected:
    doctest:1172: DeprecationWarning: This function is deprecated.  Use sqrt with a given number of bits of precision instead.
    2.2360679774997896964091736687312762354406183596115257242709
Got:
    doctest:1176: DeprecationWarning: This function is deprecated.  Use sqrt with a given number of bits of precision instead.
    2.2360679774997896964091736687312762354406183596115257242709
**********************************************************************
1 items had failures:
   1 of   5 in __main__.example_118
***Test Failed*** 1 failures.
For whitespace errors, see the file /home/leif/.sage//tmp/.doctest_integer.py
 [16.4 s]
 
----------------------------------------------------------------------
The following tests failed:


sage -t -long "devel/sage/sage/rings/integer.pyx"
Total time for all tests: 16.4 seconds
$ ./sage -t  -long devel/sage/sage/rings/rational.pyx 
sage -t -long "devel/sage/sage/rings/rational.pyx"          
**********************************************************************
File "devel/sage/sage/rings/rational.pyx", line 1339:
    sage: (5/3).sqrt_approx()
Expected:
    doctest:1172: DeprecationWarning: This function is deprecated.  Use sqrt with a given number of bits of precision instead.
    1.29099444873581
Got:
    doctest:1176: DeprecationWarning: This function is deprecated.  Use sqrt with a given number of bits of precision instead.
    1.29099444873581
**********************************************************************
1 items had failures:
   1 of   6 in __main__.example_31
***Test Failed*** 1 failures.
For whitespace errors, see the file /home/leif/.sage//tmp/.doctest_rational.py
 [4.5 s]
 
----------------------------------------------------------------------
The following tests failed:


sage -t -long "devel/sage/sage/rings/rational.pyx"
Total time for all tests: 4.6 seconds

These failures occurred just because some line numbers in $SAGE_LOCAL/bin/ncadoctest.py changed (when I added some flush statements).

Component: doctest coverage

Keywords: DeprecationWarning failure integer.pyx rational.pyx beginner

Author: Leif Leonhardy

Reviewer: Minh Van Nguyen

Merged: sage-4.6.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/9859

@nexttime nexttime mannequin added this to the sage-4.6 milestone Sep 6, 2010
@nexttime nexttime mannequin added t: tests labels Sep 6, 2010
@nexttime nexttime mannequin assigned sagetrac-mvngu Sep 6, 2010
@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 6, 2010

comment:1

Minh, please excuse and change the component in case it's the wrong one. (I'm not sure if "doctest" refers to the framework or doctest failures in general.)

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 6, 2010

Based on Sage 4.5.3.rc0. Apply to Sage library.

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 6, 2010

Changed work issues from Replace line numbers in doctests by ellipses. to none

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 6, 2010

comment:2

Attachment: trac_9859-fix_hard-coded_doctest_line_numbers.patch.gz

Ok, I'm a beginner. ;-)

(I've uploaded a patch.)

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 6, 2010

Author: Leif Leonhardy

@nexttime nexttime mannequin added the s: needs review label Sep 6, 2010
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 7, 2010

comment:3

Those hard-coded line numbers that leif fixed shouldn't have been there in the first place. The patch applied OK against Sage 4.5.3.rc0, all doctests (including long) passed, and the standard documentation built fine. And I'm OK with the changes in the patch.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 7, 2010

Reviewer: Minh Van Nguyen

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Sep 7, 2010

comment:4

Replying to @sagetrac-mvngu:

Those hard-coded line numbers that leif fixed shouldn't have been there in the first place.

Yes. According to Mercurial, Michael Abshoff introduced that in Jan 2009(!)... :-)
(There's no ticket number in the commit message. I'm not sure when it really got merged, but obviously long time ago.)

I wonder why I never ran into this before, since I frequently doctest with modified versions of ncadoctest (but perhaps incidentally not the whole Sage library, or sage/rings).

Thanks for reviewing this.

@qed777
Copy link
Mannequin

qed777 mannequin commented Sep 15, 2010

Merged: sage-4.6.alpha1

@qed777 qed777 mannequin removed the s: positive review label Sep 15, 2010
@qed777 qed777 mannequin closed this as completed Sep 15, 2010
@fchapoton

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant