Skip to content

Commit 220208d

Browse files
author
Release Manager
committed
gh-36896: `src/sage/interfaces/{gap,kenzo,scilab}`: fix doctests warnings Fix warnings like ``` File "src/sage/interfaces/gap.py", line 1509, in sage.interfaces.gap.gap_reset_workspace Warning: Variable 'gap' referenced here was set only in doctest marked '# long time' P = [Process(target=gap, args=("14242",)) for i in range(4)] File "src/sage/interfaces/kenzo.py", line 134, in sage.interfaces.kenzo.Sphere Warning: Consider using a block-scoped tag by inserting the line 'sage: # optional - kenzo' just before this line to avoid repeating the tag 4 times from sage.interfaces.kenzo import Sphere # optional - kenzo File "src/sage/interfaces/scilab.py", line 252, in sage.interfaces.scilab.Scilab.set_seed Warning: Consider using a block-scoped tag by inserting the line 'sage: # optional - scilab' just before this line to avoid repeating the tag 4 times from sage.interfaces.scilab import Scilab # optional - scilab ``` We also use more block scope tags. However, we let one warning in `src/sage/interfaces/gp.py`. This is a doctest with `# 32-bit` and `# 64-bit` tags. ``` File "src/sage/interfaces/gp.py", line 799, in sage.interfaces.gp.Gp.new_with_bits_prec Warning: Variable 'pi_def' referenced here was set only in doctest marked '# needs sage.libs.pari sage.symbolic' pi_def.precision() ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36896 Reported by: David Coudert Reviewer(s): Matthias Köppe
2 parents 9b10837 + 78ac95b commit 220208d

File tree

3 files changed

+166
-147
lines changed

3 files changed

+166
-147
lines changed

src/sage/interfaces/gap.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,20 +1509,21 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
15091509
We temporarily need to change the worksheet filename, and to set
15101510
``first_try=True`` to ensure that the new workspace is created::
15111511
1512+
sage: # long time
15121513
sage: ORIGINAL_WORKSPACE = sage.interfaces.gap.WORKSPACE
15131514
sage: saved_first_try = sage.interfaces.gap.first_try
15141515
sage: sage.interfaces.gap.first_try = True
15151516
sage: sage.interfaces.gap.WORKSPACE = tmp_filename()
15161517
sage: from multiprocessing import Process
15171518
sage: import time
1518-
sage: gap = Gap() # long time (reset GAP session)
1519+
sage: gap = Gap() # reset GAP session
15191520
sage: P = [Process(target=gap, args=("14242",)) for i in range(4)]
1520-
sage: for p in P: # long time, indirect doctest
1521+
sage: for p in P: # indirect doctest
15211522
....: p.start()
15221523
....: time.sleep(float(0.2))
1523-
sage: for p in P: # long time
1524+
sage: for p in P:
15241525
....: p.join()
1525-
sage: os.unlink(sage.interfaces.gap.WORKSPACE) # long time
1526+
sage: os.unlink(sage.interfaces.gap.WORKSPACE)
15261527
sage: sage.interfaces.gap.WORKSPACE = ORIGINAL_WORKSPACE
15271528
sage: sage.interfaces.gap.first_try = saved_first_try
15281529
"""

0 commit comments

Comments
 (0)