Skip to content

Commit

Permalink
Added new test for heatmap (#2904)
Browse files Browse the repository at this point in the history
* Added new test for heatmap annotation

* Fixed typo in test_matrix.py

* changed deprecated method
  • Loading branch information
codemurt committed Aug 3, 2022
1 parent 079a90d commit d504beb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_matrix.py
Expand Up @@ -264,7 +264,7 @@ def test_cmap_with_properties(self):
hm = mat._HeatMapper(self.df_unif, **kws)
npt.assert_array_equal(cmap(np.inf), hm.cmap(np.inf))

def test_tickabels_off(self):
def test_ticklabels_off(self):
kws = self.default_kws.copy()
kws['xticklabels'] = False
kws['yticklabels'] = False
Expand Down Expand Up @@ -346,6 +346,12 @@ def test_heatmap_annotation_other_data(self):
assert text.get_text() == f"{val:.1f}"
assert text.get_fontsize() == 14

def test_heatmap_annotation_different_shapes(self):

annot_data = self.df_norm.iloc[:-1]
with pytest.raises(ValueError):
mat.heatmap(self.df_norm, annot=annot_data)

def test_heatmap_annotation_with_limited_ticklabels(self):
ax = mat.heatmap(self.df_norm, fmt=".2f", annot=True,
xticklabels=False, yticklabels=False)
Expand Down

0 comments on commit d504beb

Please sign in to comment.