Skip to content
Open
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
25 changes: 25 additions & 0 deletions tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,3 +2015,28 @@ def test_with_columns(table):
t = table.with_columns()

assert table is t
#New
import warnings
from datascience import Table


def test_scatter_colors_warning():
t = Table().with_columns(
"x", [1, 2, 3],
"y", [4, 5, 6]
)

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")

try:
t.scatter("x", "y", colors="x")
except Exception:
# This crash is expected due to matplotlib
pass

# 👇 IMPORTANT: assertion OUTSIDE try block
assert any(
"removed" in str(warning.message)
for warning in w
)