Skip to content

Commit

Permalink
update unitests to cope with NCBI changes. disable skbio test tempora…
Browse files Browse the repository at this point in the history
…rily
  • Loading branch information
jhcepas committed Aug 29, 2020
1 parent e919cce commit 51761b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ete3/ncbi_taxonomy/ncbiquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ def update_db(dbfile, targz_file=None):
print("Updating database: %s ..." %dbfile)
generate_table(t)

open("syn.tab", "w").write('\n'.join(["%s\t%s" %(v[0],v[1]) for v in synonyms]))
with open("syn.tab", "w") as SYN:
SYN.write('\n'.join(["%s\t%s" %(v[0],v[1]) for v in synonyms]))

with open("merged.tab", "w") as merged:
for line in tar.extractfile("merged.dmp"):
Expand Down
10 changes: 9 additions & 1 deletion ete3/test/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ def test_parent_child_table(self):
newick = tree.write(format_root_node=True, format=1)
self.assertEqual(newick, "(B:0.1,(D:1,E:1.5)C:0.2)A:1;")

def test_skbio(self):

# Disabled temporarily. following error is reported:
#
# File "/home/travis/build/etetoolkit/ete/test_tmp/miniconda3/envs/test_3.5/lib/python3.5/site-packages/parso/__init__.py", line 41, in <module>
# from parso.parser import ParserSyntaxError
# File "/home/travis/build/etetoolkit/ete/test_tmp/miniconda3/envs/test_3.5/lib/python3.5/site-packages/parso/parser.py", line 113
# node_map: Dict[str, type] = {}
# SyntaxError: invalid syntax
def disabled_test_skbio(self):
from skbio import TreeNode
skb_tree = TreeNode.read([u"(B:0.1,(D:1,E:1.5)C:0.2)A:1;"])
for node in skb_tree.traverse():
Expand Down
6 changes: 3 additions & 3 deletions ete3/test/test_ncbiquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def test_ncbiquery(self):
#Out[10]: [63221, 741158, 2665953, 1425170]
self.assertEqual(set(out), set([63221, 741158, 2665953, 1425170]))

out = ncbi.get_descendant_taxa("9605", intermediate_nodes=False, rank_limit="species")
#Out[11]: [9606, 1425170]
self.assertEqual(set(out), set([9606, 1425170]))
out = ncbi.get_descendant_taxa("9596", intermediate_nodes=False, rank_limit="species")
#Out[11]: [9597, 9598]
self.assertEqual(set(out), set([9597, 9598]))

def test_get_topology(self):
ncbi = NCBITaxa(dbfile=DATABASE_PATH)
Expand Down

0 comments on commit 51761b6

Please sign in to comment.