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 a few issues occuring when doctesting with pytest #33856

Open
tobiasdiez opened this issue May 16, 2022 · 11 comments
Open

Fix a few issues occuring when doctesting with pytest #33856

tobiasdiez opened this issue May 16, 2022 · 11 comments

Comments

@tobiasdiez
Copy link
Contributor

Namely

E   ValueError: line 18 of the docstring for sage.databases.findstat._submit has inconsistent leading whitespace: '[1,2,3]=>83",'
E   ValueError: line 42 of the docstring for sage.databases.sql_db._create_print_table has inconsistent leading whitespace: '--------------------'
E   ValueError: line 8 of the docstring for sage.doctest.control.Logger.__init__ has inconsistent leading whitespace: '")  # no-op'
E   ValueError: line 12 of the docstring for sage.doctest.sources.StringDocTestSource.__iter__ has inconsistent leading whitespace: '\'\'\'"'
E   ValueError: line 29 of the docstring for sage.game_theory.normal_form_game.NormalFormGame._lrs_nash_format has inconsistent leading whitespace: "', legacy_format[0])"
E   ValueError: line 36 of the docstring for sage.repl.rich_output.backend_emacs.BackendEmacs.displayhook has inconsistent leading whitespace: "BEGIN_LATEX:\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\int \\sin\\left(x\\right)\\,{d x}:END_LATEX'},"
E   ValueError: line 17 of the docstring for sage.parallel.decorate.ParallelFunction._instancedoc_ has inconsistent leading whitespace: "'"
E   ValueError: line 13 of the docstring for sage.databases.findstat.FindStatStatistic._fetch_data has inconsistent leading whitespace: "    return len(x.nestings())',"

-> convert to r"""...""" strings

___________ ERROR collecting sage/ext_data/nbconvert/postprocess.py ____________
sage/ext_data/nbconvert/postprocess.py:20: in <module>
    with open(file_name, 'r') as f:
E   FileNotFoundError: [Errno 2] No such file or directory: '-c'

sage/repl/ipython_kernel/__main__.py:3: in <module>
...
__main__.py: error: unrecognized arguments: --doctest-modules

sage_setup/autogen/giacpy-mkkeywords.py:49: in <module>
    with open('aide_cas.txt') as f:
E   FileNotFoundError: [Errno 2] No such file or directory: 'aide_cas.txt'


 __________________________ ERROR collecting setup.py ___________________________
 E   getopt.GetoptError: option -c not recognized

_________________________ ERROR collecting sage/all.py _________________________
sage/all.py:285: in <module>
    sage.misc.lazy_import.finish_startup()
sage/misc/lazy_import.pyx:87: in sage.misc.lazy_import.finish_startup
    cpdef finish_startup():
sage/misc/lazy_import.pyx:103: in sage.misc.lazy_import.finish_startup
    assert startup_guard, 'finish_startup() must be called exactly once'
E   AssertionError: finish_startup() must be called exactly once

-> ignore from test collection

________ ERROR collecting sage/geometry/polyhedron/backend_normaliz.py _________
sage/misc/lazy_import.pyx:253: in sage.misc.lazy_import.LazyImport._get_object
    self._object = getattr(__import__(self._module, {}, {}, [self._name]), self._name)
E   ModuleNotFoundError: No module named 'PyNormaliz'

-> skip if feature is not installed

sage/homology/cubical_complex.py:16: in <module>
    cubical_complexes = deprecated_function_alias(31925,
sage/misc/superseded.py:558: in deprecated_function_alias
    return DeprecatedFunctionAlias(trac_number, func, module_name)
sage/misc/superseded.py:379: in __init__
    doc += 'Use :' + sphinxrole + ':`' + self.func.__name__ + '` instead.\n'
E   AttributeError: 'CubicalComplexExamples' object has no attribute '__name__'

-> add proper handling of classes

Depends on #33546
Depends on #33879

CC: @mkoeppe @fchapoton @jhpalmieri @dimpase

Component: build

Author: Tobias Diez

Branch/Commit: public/build/pytest_doctests_fixes @ fba3488

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

@tobiasdiez tobiasdiez added this to the sage-9.7 milestone May 16, 2022
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 21, 2022

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

027adcaMerge remote-tracking branch 'origin/public/tests/pytest_doctests' into public/build/pytest-github-workflow
86f7da0Add pytest step
36be012Merge remote-tracking branch 'origin/public/build/pytest-github-workflow' into public/build/pytest_doctests_fixes
91e4b95Fix superseded

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 21, 2022

Changed commit from 8425597 to 91e4b95

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 21, 2022

Changed commit from 91e4b95 to ed921ed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 21, 2022

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

ed921edAdd proper fallback for classes

@tobiasdiez

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 22, 2022

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

7398c26Ignore exectuable scripts

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 22, 2022

Changed commit from ed921ed to 7398c26

@tobiasdiez
Copy link
Contributor Author

Changed dependencies from #33546 to #33546, #33879

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 3, 2022

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

59af8cbMerge remote-tracking branch 'trac/develop' into public/build/pytest_doctests_fixes
5a53601Also fix newline doc issue in findstat
fba3488Fix catching import error due to missing feature

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 3, 2022

Changed commit from 7398c26 to fba3488

@tobiasdiez

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Apr 30, 2023
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

2 participants