Skip to content

Commit

Permalink
Trac #32696: 1 internet doctest failing in src/sage/finance/stock.py
Browse files Browse the repository at this point in the history
With Ubuntu 18.04 and 9.5.beta3, the command
{{{
$ sage -t --optional=sage,internet src/sage/finance/stock.py
}}}
gives
{{{
Using --optional=internet,sage
Doctesting 1 file.
sage -t --random-seed=0 src/sage/finance/stock.py
**********************************************************************
File "src/sage/finance/stock.py", line 553, in
sage.finance.stock.Stock.load_from_file
Failed example:
    finance.Stock('aapl').load_from_file(filename)[:5]
Expected:
    doctest:warning...
    DeprecationWarning: Importing finance from here is deprecated...
    [
    1212408060 188.00 188.00 188.00 188.00        687,
    1212408000 188.00 188.11 188.00 188.00       2877,
    1212407700 188.00 188.00 188.00 188.00       1000,
    1212407640 187.75 188.00 187.75 188.00       2000,
    1212405780 187.80 187.80 187.80 187.80        100
    ]
Got:
    [
    1212408060 188.00 188.00 188.00 188.00        687,
    1212408000 188.00 188.11 188.00 188.00       2877,
    1212407700 188.00 188.00 188.00 188.00       1000,
    1212407640 187.75 188.00 187.75 188.00       2000,
    1212405780 187.80 187.80 187.80 187.80        100
    ]
**********************************************************************
1 item had failures:
   1 of   5 in sage.finance.stock.Stock.load_from_file
    [26 tests, 1 failure, 0.01 s]
----------------------------------------------------------------------
sage -t --random-seed=0 src/sage/finance/stock.py  # 1 doctest failed
----------------------------------------------------------------------
}}}

URL: https://trac.sagemath.org/32696
Reported by: slabbe
Ticket author(s): Sébastien Labbé
Reviewer(s): Frédéric Chapoton
  • Loading branch information
Release Manager committed Nov 15, 2021
2 parents c87b264 + 9117551 commit a95cfc5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/sage/finance/stock.py
Expand Up @@ -551,9 +551,7 @@ def load_from_file(self, file):
sage: with open(filename, 'w') as fobj:
....: _ = fobj.write("Date,Open,High,Low,Close,Volume\n1212405780,187.80,187.80,187.80,187.80,100\n1212407640,187.75,188.00,187.75,188.00,2000\n1212407700,188.00,188.00,188.00,188.00,1000\n1212408000,188.00,188.11,188.00,188.00,2877\n1212408060,188.00,188.00,188.00,188.00,687")
sage: finance.Stock('aapl').load_from_file(filename)[:5]
doctest:warning...
DeprecationWarning: Importing finance from here is deprecated...
[
...
1212408060 188.00 188.00 188.00 188.00 687,
1212408000 188.00 188.11 188.00 188.00 2877,
1212407700 188.00 188.00 188.00 188.00 1000,
Expand Down

0 comments on commit a95cfc5

Please sign in to comment.