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 doctest in gap_packages (using empty table) #37147

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/sage/misc/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def _widths(self):
widths = w
return tuple(widths)

def _repr_(self):
def _repr_(self) -> str:
r"""
String representation of a table.

Expand Down Expand Up @@ -470,7 +470,8 @@ def _repr_(self):

for row in rows[:-1]:
s += self._str_table_row(row, header_row=False)
s += self._str_table_row(rows[-1], header_row=False, last_row=True)
if rows:
s += self._str_table_row(rows[-1], header_row=False, last_row=True)
return s.strip("\n")

def _rich_repr_(self, display_manager, **kwds):
Expand Down
16 changes: 8 additions & 8 deletions src/sage/tests/gap_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sage: pkgs = all_installed_packages(ignore_dot_gap=True)
sage: test_packages(pkgs, only_failures=True) # optional - gap_packages
Status Package GAP Output
+--------+---------+------------+
├────────┼─────────┼────────────┤

sage: test_packages(['primgrp', 'smallgrp'])
Status Package GAP Output
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_packages(packages, only_failures=False):

sage: pkgs = all_installed_packages()
sage: test_packages(pkgs) # random output
Status Package GAP Output
+---------+------------+------------+
Alnuth true
GAPDoc true
sonata true
tomlib true
toric true
Status Package GAP Output
├────────┼─────────┼────────────┤
Alnuth true
GAPDoc true
sonata true
tomlib true
toric true
"""
rows = [['Status', 'Package', 'GAP Output']]
for pkgdir in packages:
Expand Down
Loading