Opened 6 years ago

Closed 4 years ago

#14276 closed enhancement (wontfix)

New doctesting marker: require failure

Reported by: roed Owned by: mvngu
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:

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 roed 6 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 6 years ago by roed

  • Status changed from new to needs_review

comment:2 Changed 6 years ago by jdemeyer

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 6 years ago by jdemeyer (previous) (diff)

comment:3 Changed 6 years ago by jdemeyer

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 6 years ago by jdemeyer

  • Status changed from needs_review to needs_info

comment:5 Changed 6 years ago by roed

  • Dependencies changed from #12415 to #12281

Changed 6 years ago by roed

comment:6 Changed 6 years ago by roed

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 6 years ago by roed

  • Status changed from needs_info to needs_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 6 years ago by roed

  • Component changed from doctest to doctest framework

comment:9 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:10 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:11 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:12 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:13 Changed 4 years ago by ncohen

  • Status changed from needs_review to needs_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 4 years ago by jdemeyer

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

comment:15 Changed 4 years ago by ncohen

  • Milestone changed from sage-6.4 to sage-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 4 years ago by roed

I'm fine closing this.

comment:17 Changed 4 years ago by ncohen

  • Status changed from needs_info to positive_review

comment:18 Changed 4 years ago by vbraun

  • Resolution set to wontfix
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.