Skip to content

Commit 6b9fd0e

Browse files
committed
Обновлены тесты
1 parent fe23a67 commit 6b9fd0e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/visualizers/test_fingerprinting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_fingerprinting_type_error():
1919
def test_fingerprinting(texts):
2020
plt.cla()
2121
plot = fingerprinting(texts, x_size=600, y_size=500)
22-
assert type(plot) == Figure
22+
assert isinstance(plot, Figure)
2323
assert len(plot.axes) == 2
2424
assert plot.axes[0].title.get_text() == "Литературная дактилоскопия"
2525
assert plot.axes[0].title.get_position() == (0.5, 1.0)
@@ -37,4 +37,4 @@ def test_fingerprinting_is_return(texts):
3737
def test_fingerprinting_metric(texts):
3838
plt.cla()
3939
plot = fingerprinting(texts, metric=calc_simpson_index)
40-
assert type(plot) == Figure
40+
assert isinstance(plot, Figure)

tests/visualizers/test_word_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def texts():
1111

1212
def test_wordtree_type_error():
1313
with pytest.raises(TypeError):
14-
wordtree(1)
14+
wordtree(1, "тест")
1515

1616

1717
def test_wordtree_value_error(texts):
@@ -21,6 +21,6 @@ def test_wordtree_value_error(texts):
2121

2222
def test_wordtree(texts):
2323
g = wordtree(texts, "рабочий", max_n=2)
24-
assert type(g) == Digraph
24+
assert isinstance(g, Digraph)
2525
assert len(g.body) == 11
2626
assert g.name == "рабочий"

tests/visualizers/test_zipf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def tokens():
1515
def test_zipf_theory():
1616
plt.cla()
1717
plot = zipf_theory(10, 5, 1.0)[0]
18-
assert type(plot) == Line2D
18+
assert isinstance(plot, Line2D)
1919
assert plot._label == "Теоретический закон"
2020
assert plot.get_linewidth() == 2
2121
assert plot.get_color() == "r"
@@ -29,7 +29,7 @@ def test_zipf_type_error():
2929
def test_zipf(tokens):
3030
plt.cla()
3131
plot = zipf(tokens)
32-
assert type(plot) == Line2D
32+
assert isinstance(plot, Line2D)
3333
assert plot._label == "Экспериментальный закон"
3434
assert plot.axes.title.get_text() == "Закон Ципфа"
3535
assert plot.axes.title.get_position() == (0.5, 1.0)
@@ -66,4 +66,4 @@ def test_zipf_with_theory(tokens):
6666
plt.cla()
6767
plot = zipf(tokens, show_theory=True)
6868
assert len(plot) == 1
69-
assert all(type(p) == Line2D for p in plot)
69+
assert all(isinstance(p, Line2D) for p in plot)

0 commit comments

Comments
 (0)