Skip to content

Commit

Permalink
Add tests for view_annotate
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Nov 14, 2024
1 parent b2d5c78 commit e78897f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/sage/misc/cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,23 @@ def cython(filename, verbose=0, compile_message=False,
RuntimeError: Error compiling Cython file:
...
...: 'sage/misc.pxd' not found
Test ``view_annotate``::
sage: cython('''
....: def f(int n):
....: return n*n
....: ''', view_annotate=True) # optional -- webbrowser
::
sage: cython('''
....: def f(int n):
....: return n*n
....: ''', view_annotate=True, annotate=False)
Traceback (most recent call last):
...
ValueError: Cannot view annotated file without creating it
"""
if not filename.endswith('pyx'):
print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr)
Expand Down

0 comments on commit e78897f

Please sign in to comment.