99directory = os .path .dirname (os .path .abspath (__file__ ))
1010
1111
12- def test_read_taxrank_file ():
12+ def test_read_taxrank_file () -> None :
1313 """
1414 Test reading the taxrank ontology OBO file.
1515 """
@@ -24,20 +24,20 @@ def test_read_taxrank_file():
2424
2525@pytest .mark .parametrize ("extension" , ["" , ".gz" , ".bz2" , ".xz" ])
2626@pytest .mark .parametrize ("pathlike" , [False , True ])
27- def test_read_taxrank_path (extension , pathlike ) :
27+ def test_read_taxrank_path (extension : str , pathlike : bool ) -> None :
2828 """
2929 Test reading the taxrank ontology OBO file from paths. Includes reading
3030 compressed paths.
3131 """
3232 path = os .path .join (directory , "data" , "taxrank.obo" + extension )
3333 if pathlike :
34- path = pathlib .Path (path )
34+ path = pathlib .Path (path ) # type: ignore [assignment]
3535 taxrank = obonet .read_obo (path )
3636 assert len (taxrank ) == 61
3737
3838
3939@pytest .mark .parametrize ("extension" , ["" , ".gz" , ".bz2" , ".xz" ])
40- def test_read_taxrank_url (extension ) :
40+ def test_read_taxrank_url (extension : str ) -> None :
4141 """
4242 Test reading the taxrank ontology OBO file from paths. Includes reading
4343 compressed paths.
@@ -48,7 +48,7 @@ def test_read_taxrank_url(extension):
4848 assert len (taxrank ) == 61
4949
5050
51- def test_read_brenda_subset ():
51+ def test_read_brenda_subset () -> None :
5252 """
5353 Test reading a subset of the BrendaTissue.obo file. This file does not set
5454 the ontology tag. See <https://github.com/dhimmel/obonet/issues/10>.
@@ -64,7 +64,7 @@ def test_read_brenda_subset():
6464
6565
6666@pytest .mark .parametrize ("ontology" , ["doid" , "go" , "pato" ])
67- def test_read_obo (ontology ) :
67+ def test_read_obo (ontology : str ) -> None :
6868 """
6969 Test that reading ontology does not error.
7070 """
@@ -73,7 +73,7 @@ def test_read_obo(ontology):
7373 assert graph
7474
7575
76- def test_parse_tag_line_newline_agnostic ():
76+ def test_parse_tag_line_newline_agnostic () -> None :
7777 for line in ["saved-by: vw" , "saved-by: vw\n " ]:
7878 tag , value , trailing_modifier , comment = parse_tag_line (line )
7979 assert tag == "saved-by"
@@ -82,7 +82,7 @@ def test_parse_tag_line_newline_agnostic():
8282 assert comment is None
8383
8484
85- def test_parse_tag_line_with_tag_and_value ():
85+ def test_parse_tag_line_with_tag_and_value () -> None :
8686 line = 'synonym: "ovarian ring canal" NARROW []\n '
8787 tag , value , trailing_modifier , comment = parse_tag_line (line )
8888 assert tag == "synonym"
@@ -91,7 +91,7 @@ def test_parse_tag_line_with_tag_and_value():
9191 assert comment is None
9292
9393
94- def test_parse_tag_line_with_tag_value_and_comment ():
94+ def test_parse_tag_line_with_tag_value_and_comment () -> None :
9595 line = "is_a: GO:0005102 ! receptor binding\n "
9696 tag , value , trailing_modifier , comment = parse_tag_line (line )
9797 assert tag == "is_a"
@@ -100,7 +100,7 @@ def test_parse_tag_line_with_tag_value_and_comment():
100100 assert comment == "receptor binding"
101101
102102
103- def test_parse_tag_line_with_tag_value_and_trailing_modifier ():
103+ def test_parse_tag_line_with_tag_value_and_trailing_modifier () -> None :
104104 line = 'xref: UMLS:C0226369 {source="ncithesaurus:Obturator_Artery"}\n '
105105 tag , value , trailing_modifier , comment = parse_tag_line (line )
106106 assert tag == "xref"
@@ -109,7 +109,7 @@ def test_parse_tag_line_with_tag_value_and_trailing_modifier():
109109 assert comment is None
110110
111111
112- def test_parse_tag_line_with_tag_value_trailing_modifier_and_comment ():
112+ def test_parse_tag_line_with_tag_value_trailing_modifier_and_comment () -> None :
113113 line = 'xref: UMLS:C0022131 {source="ncithesaurus:Islet_of_Langerhans"} ! Islets of Langerhans\n ' # noqa: E501
114114 tag , value , trailing_modifier , comment = parse_tag_line (line )
115115 assert tag == "xref"
@@ -118,22 +118,22 @@ def test_parse_tag_line_with_tag_value_trailing_modifier_and_comment():
118118 assert comment == "Islets of Langerhans"
119119
120120
121- def test_parse_tag_line_backslashed_exclamation ():
121+ def test_parse_tag_line_backslashed_exclamation () -> None :
122122 line = "synonym: not a real example \\ !\n "
123123 tag , value , trailing_modifier , comment = parse_tag_line (line )
124124 assert tag == "synonym"
125125 assert value == r"not a real example \!"
126126
127127
128- def test_ignore_obsolete_nodes ():
128+ def test_ignore_obsolete_nodes () -> None :
129129 """Quick verification that the change doesn't break anything"""
130130 path = os .path .join (directory , "data" , "brenda-subset.obo" )
131131 brenda = obonet .read_obo (path )
132132 nodes = brenda .nodes (data = True )
133133 assert "BTO:0000311" not in nodes
134134
135135
136- def test_presence_of_obsolete_nodes ():
136+ def test_presence_of_obsolete_nodes () -> None :
137137 """Test that we did, indeed, capture those obsolete entries"""
138138 pytest .importorskip ("networkx" , minversion = "2.0" )
139139 path = os .path .join (directory , "data" , "brenda-subset.obo" )
0 commit comments