Skip to content

labels in multiline doctests #33091

@tornaria

Description

@tornaria

I'm occasionally getting this timeout:

sage -t --random-seed=39014585829676668007219039140784171913 src/sage/matrix/matrix2.pyx
    Timed out
**********************************************************************
Tests run before process (pid=6202) timed out:
...
...
sage: all(L.change_ring(SR).is_Z_operator_on(K)
    for L in K.Z_operators_gens())  # long time ## line 17218 ##
------------------------------------------------------------------------

I'm not using --long here, but this test is still running.

This is fixed if the # long time label is moved to the first line of the doctest.

The same file contains other multiline doctests labeled long in the second line.

In this ticket:

  • We document that the label belongs on the first line.
  • We add a test for this fairly common mistake to the linter (./sage -tox -e relint)
  • We fix all uses

Depends on #33096

CC: @orlitzky

Component: doctest framework

Author: Michael Orlitzky, Matthias Koeppe

Reviewer: Matthias Koeppe, ...

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions