File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def test_fingerprinting_type_error():
1919def 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):
3737def 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 )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def texts():
1111
1212def test_wordtree_type_error ():
1313 with pytest .raises (TypeError ):
14- wordtree (1 )
14+ wordtree (1 , "тест" )
1515
1616
1717def test_wordtree_value_error (texts ):
@@ -21,6 +21,6 @@ def test_wordtree_value_error(texts):
2121
2222def 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 == "рабочий"
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def tokens():
1515def 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():
2929def 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 )
You can’t perform that action at this time.
0 commit comments