Skip to content

Commit

Permalink
fix: const test check shape instead of str output
Browse files Browse the repository at this point in the history
  • Loading branch information
yue.jiao committed Dec 18, 2024
1 parent 10da764 commit 2f3e9fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sklearnex/manifold/tests/test_tsne.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def test_basic_tsne_functionality():

# Edge case: constant data
X_constant = np.ones((10, 10))
with pytest.raises(ValueError) as excinfo:
TSNE(n_components=2, perplexity=20).fit(X_constant)
assert "perplexity must be less than n_samples" in str(excinfo.value)
tsne = TSNE(n_components=2, perplexity=5, random_state=42)
embedding = tsne.fit(X_constant).embedding_
assert embedding.shape == (10, 2), f"Unexpected embedding shape: {embedding.shape}"

# Edge case: empty data
X_empty = np.empty((0, 10))
Expand Down

0 comments on commit 2f3e9fa

Please sign in to comment.