Opened 6 months ago

Closed 5 months ago

#27781 closed defect (duplicate)

2 doctests failing in src/sage/misc/package.py when --optional=sage,internet

Reported by: slabbe Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: doctest coverage Keywords: thursdaysbdx
Cc: vklein Merged in:
Authors: Sébastien Labbé Reviewers: Vincent Klein
Report Upstream: N/A Work issues:
Branch: u/slabbe/27781 (Commits) Commit: cb6ddf3a221b92ed2e7dc8e8b87226c34ee21b7f
Dependencies: Stopgaps:

Description

With SageMath version 8.8.beta4, Release Date: 2019-05-04,

sage -t --long src/sage/misc/package.py

is ok:

Using --optional=4ti2,bliss,build,cbc,ccache,cmake,cryptominisat,dochtml,dot2tex,e_antic,glucose,latte_int,lidia,lrslib,memlimit,mpir,ninja_build,normaliz,notedown,pandoc_attributes,pycosat,pynormaliz,python2,qhull,rst2ipynb,sage,topcom
Doctesting 1 file.
sage -t --long src/sage/misc/package.py
    [45 tests, 2.35 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------

but with tag internet:

sage -t --long --optional=sage,internet src/sage/misc/package.py

gives

Using --optional=internet,memlimit,sage
Doctesting 1 file.
sage -t --long src/sage/misc/package.py
**********************************************************************
File "src/sage/misc/package.py", line 202, in sage.misc.package.list_packages
Failed example:
    L['beautifulsoup']
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.package.list_packages[3]>", line 1, in <module>
        L['beautifulsoup']
    KeyError: 'beautifulsoup'
**********************************************************************
File "src/sage/misc/package.py", line 368, in sage.misc.package.package_versions
Failed example:
    std['zn_poly']  # random
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.package.package_versions[0]>", line 1, in <module>
        std['zn_poly']  # random
    TypeError: 'function' object has no attribute '__getitem__'
**********************************************************************
2 items had failures:
   1 of   5 in sage.misc.package.list_packages
   1 of   2 in sage.misc.package.package_versions
    [25 tests, 2 failures, 1.07 s]
----------------------------------------------------------------------
sage -t --long src/sage/misc/package.py  # 2 doctests failed
----------------------------------------------------------------------

Change History (7)

comment:1 Changed 5 months ago by slabbe

Probably caused by #27635

comment:2 Changed 5 months ago by slabbe

It has to do with tag build. When missing it creates issues. Because with --optional=sage,internet,build it works:

sage -t --long --optional=sage,internet,build src/sage/misc/package.py

gives

Using --optional=build,internet,memlimit,sage
Doctesting 1 file.
sage -t --long src/sage/misc/package.py
    [49 tests, 10.22 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 10.2 seconds
    cpu time: 0.3 seconds
    cumulative wall time: 10.2 seconds

comment:3 Changed 5 months ago by slabbe

  • Authors set to Sébastien Labbé
  • Branch set to u/slabbe/27781
  • Commit set to cb6ddf3a221b92ed2e7dc8e8b87226c34ee21b7f
  • Status changed from new to needs_review

New commits:

cb6ddf327781: missing build tag in doctests

comment:4 Changed 5 months ago by slabbe

  • Cc vklein added

comment:5 Changed 5 months ago by vklein

  • Keywords thursdaysbdx added

comment:6 Changed 5 months ago by vklein

  • Reviewers set to Vincent Klein

Looks good to me.

comment:7 Changed 5 months ago by embray

  • Milestone changed from sage-8.8 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from needs_review to closed

Thanks, but this was already fixed (duplicate of #27766).

Note: See TracTickets for help on using tickets.