Opened 10 years ago

Closed 8 years ago

#14276 closed enhancement (wontfix)

New doctesting marker: require failure

Reported by: David Roe Owned by: Minh Van Nguyen
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: doctest framework Keywords:
Cc: Merged in:
Authors: David Roe Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #12281 Stopgaps:

Status badges

Description

From a discussion on sage-combinat-devel:

Add a new marker for doctests, # require failure, which makes the test fail if the output is the same as the expected output and succeed otherwise.

See also #13278.

Attachments (1)

14276.patch (5.7 KB) - added by David Roe 10 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 10 years ago by David Roe

Status: newneeds_review

comment:2 Changed 10 years ago by Jeroen Demeyer

I have read the thread, but I don't understand the point. What's wrong with

sage: 2 + 2   # should be 4 if #56789 is fixed
5

or

sage: 2 + 2   # known bug: #56789
4
Last edited 10 years ago by Jeroen Demeyer (previous) (diff)

comment:3 Changed 10 years ago by Jeroen Demeyer

And this makes it actually almost useless:

Note that requiring failure is not possible if the test raises an exception

If we ever implement this, we must allow exceptions as failures.

comment:4 Changed 10 years ago by Jeroen Demeyer

Status: needs_reviewneeds_info

comment:5 Changed 10 years ago by David Roe

Dependencies: #12415#12281

Changed 10 years ago by David Roe

Attachment: 14276.patch added

comment:6 Changed 10 years ago by David Roe

When the result of the test is more complicated than one number (multiple lines for example), it's easier to delete a #require failure comment than fit the correct answer into a comment and then move it once it starts working. It does seem like a fairly minor benefit though.

I've updated the patch to allow exceptions as failures.

comment:7 Changed 10 years ago by David Roe

Status: needs_infoneeds_review

I don't have a strong attachment to this feature, but someone did ask for it and it was pretty easy to implement....

comment:8 Changed 10 years ago by David Roe

Component: doctestdoctest framework

comment:9 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:10 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:11 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:12 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:13 Changed 8 years ago by Nathann Cohen

Status: needs_reviewneeds_info

Could you explain what exactly this tag is meant for in the ticket's description? The link to a sage-devel thread that you provide is an unrelated (french) message of Frederic Chapoton.

Thanks,

Nathann

comment:14 Changed 8 years ago by Jeroen Demeyer

I also don't really understand the point of this, but the link in the ticket is correct for me.

comment:15 Changed 8 years ago by Nathann Cohen

Milestone: sage-6.4sage-duplicate/invalid/wontfix

Oh. True, is only redirected me toward the last message of that thread. But it seems that people there were looking for a way to remember known bugs, while we have the more effective stopgaps for that.

Close ?

Nathann

comment:16 Changed 8 years ago by David Roe

I'm fine closing this.

comment:17 Changed 8 years ago by Nathann Cohen

Status: needs_infopositive_review

comment:18 Changed 8 years ago by Volker Braun

Resolution: wontfix
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.