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

Fix failing doctest in src/sage/interfaces/tachyon.py #29442

Closed
kliem opened this issue Apr 1, 2020 · 19 comments
Closed

Fix failing doctest in src/sage/interfaces/tachyon.py #29442

kliem opened this issue Apr 1, 2020 · 19 comments

Comments

@kliem
Copy link
Contributor

kliem commented Apr 1, 2020

sage -t src/sage/interfaces/tachyon.py
**********************************************************************
File "src/sage/interfaces/tachyon.py", line 175, in sage.interfaces.tachyon.TachyonRT.usage
Failed example:
    t.usage(use_pager=False)
Expected:
    Tachyon Parallel/Multiprocessor Ray Tracer   Version...
Got:
    Usage: tachyon modelfile [options] 
    <BLANKLINE>
    Valid options and accepted formats are as follows (** denotes default behaviour).
    <BLANKLINE>
    Model file formats supported:
...

This seems to have been introduced by using the systems tachyon. It appears that in some cases (depending on the version probably) tachyon does not print out the first lines

Tachyon Parallel/Multiprocessor Ray Tracer   Version 0.98.9   
Copyright 1994-2010,    John E. Stone <john.stone@gmail.com> 
------------------------------------------------------------ 

We fix this by testing for the following output:

...
Usage: 
  tachyon modelfile [options]...
<BLANKLINE>
Model file formats supported:
  filename.dat ...

CC: @mkoeppe

Component: interfaces

Keywords: tachyon

Author: Jonathan Kliem

Branch/Commit: 871df4b

Reviewer: Frédéric Chapoton, Matthias Koeppe

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

@kliem kliem added this to the sage-9.1 milestone Apr 1, 2020
@kliem
Copy link
Contributor Author

kliem commented Apr 1, 2020

New commits:

7c25dccfix tachyon interface error

@kliem
Copy link
Contributor Author

kliem commented Apr 1, 2020

Commit: 7c25dcc

@kliem
Copy link
Contributor Author

kliem commented Apr 1, 2020

Branch: public/29442

@kliem

This comment has been minimized.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:2

ok, thanks

@kliem
Copy link
Contributor Author

kliem commented Apr 1, 2020

comment:3

I should have double checked.

Usage: tachyon modelfile [options] 
    <BLANKLINE>
    Valid options and accepted formats are as follows (** denotes default behaviour).
    <BLANKLINE>
    Model file formats supported:

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 1, 2020

Changed commit from 7c25dcc to 80c1d75

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 1, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

80c1d75more flexible test

@kliem
Copy link
Contributor Author

kliem commented Apr 1, 2020

comment:5

Sorry, but the ticket as it was would have been pointless.


New commits:

80c1d75more flexible test

New commits:

80c1d75more flexible test

@mkoeppe
Copy link
Member

mkoeppe commented Apr 2, 2020

comment:6

I don't think doctest results starting with "..." work because they are mistaken for continuation prompts.
See https://github.com/mkoeppe/sage/runs/553984065

File "src/sage/interfaces/tachyon.py", line 175, in sage.interfaces.tachyon.TachyonRT.usage
Failed example:
    t.usage(use_pager=False)
Expected:
    ...
    Usage:
      tachyon modelfile [options]...
    Model file formats supported:
      filename.dat ...
Got:
    Usage: tachyon modelfile [options] 
    <BLANKLINE>
    Valid options and accepted formats are as follows (** denotes default behaviour).
    <BLANKLINE>

@kliem
Copy link
Contributor Author

kliem commented Apr 2, 2020

comment:7

Ok. Now, I'm testing internally the following and it seems it passes:

            sage: from sage.interfaces.tachyon import TachyonRT
            sage: t = TachyonRT()
            sage: t.usage(use_pager=False)
            ...
              tachyon modelfile [options]...
            <BLANKLINE>
            Model file formats supported:
              filename.dat ...
            sage: print("Usage: tachyon modelfile [options]\n\nValid options and accepted formats are as follows (** denotes default behaviour).\n\nModel file formats supported    +++:\n  filename.dat        the model files originated with this package")
            ...
              tachyon modelfile [options]...
            Model file formats supported:
              filename.dat ...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 2, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

871df4bdoctest should work with both versions now

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 2, 2020

Changed commit from 80c1d75 to 871df4b

@kliem
Copy link
Contributor Author

kliem commented Apr 5, 2020

comment:10

This seems to work now

https://github.com/kliem/sage-test-27122/actions/runs/70559675

There are many clean runs now.

@kliem

This comment has been minimized.

@mkoeppe
Copy link
Member

mkoeppe commented Apr 18, 2020

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, Matthias Koeppe

@mkoeppe
Copy link
Member

mkoeppe commented Apr 18, 2020

comment:12

Looks good to me.

@vbraun
Copy link
Member

vbraun commented Apr 22, 2020

Changed branch from public/29442 to 871df4b

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

4 participants