Skip to content

Commit

Permalink
Solved issues with testing, now all tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Mar 20, 2019
1 parent e41122d commit 0cd5da7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Mikado/loci/superlocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from sqlalchemy.engine import Engine
from sqlalchemy.ext import baked
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.orm import session as sasession
from sqlalchemy.sql.expression import and_
from ..transcripts.transcript import Transcript
from .abstractlocus import Abstractlocus
Expand Down Expand Up @@ -658,7 +659,8 @@ def load_all_transcript_data(self, engine=None, data_dict=None):
self.logger.debug("Finished retrieving data for %d transcripts",
len(tid_keys))
self.session.close()
self.sessionmaker.close_all()
sasession.close_all_sessions()
# self.sessionmaker.close_all_sessions()

for tid in tid_keys:
remove_flag, new_transcripts = self.load_transcript_data(tid, data_dict)
Expand Down
1 change: 1 addition & 0 deletions Mikado/tests/assigner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ def test_false_fusion(self):
args.self = False
args.extended_refmap = False
args.gzip = False
args.processes = 1

scales.compare.compare(args)

Expand Down
1 change: 1 addition & 0 deletions Mikado/tests/test_system_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ def test_compare_trinity(self):
with self.subTest(ref=ref, pred=pred):
namespace.reference = to_gff(ref)
namespace.prediction = to_gff(pred)
namespace.processes = 2
dir = tempfile.TemporaryDirectory()
namespace.log = os.path.join(dir.name, "compare_{}_{}.log".format(
files.index(ref), files.index(pred)))
Expand Down
4 changes: 3 additions & 1 deletion Mikado/tests/test_transcript_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@ def test_conversion(self):
self.assertEqual(t1, self.t1)

def test_get_coding_exons(self):
correct = [(5697,5891), (5256, 5576)]
correct = sorted([(5697,5891), (5256, 5576)])
self.t1.finalize()
self.assertIsNotNone(self.t1.coding_exons)
self.assertEqual(sorted(self.t1.coding_exons), sorted(correct))
t1 = self.t1.copy()
t1.strip_cds()
Expand Down
1 change: 1 addition & 0 deletions Mikado/transcripts/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,7 @@ def _wrapped(combined_cds, combined_cds_length, exons):
coding.append(exon)
break
continue
return coding

return _wrapped(tuple(self.combined_cds), self.combined_cds_length, tuple(self.exons))

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test=pytest

[tool:pytest]
addopts = --cov Mikado
norecursedirs = datrie*
norecursedirs = datrie* build
# filterwarnings =
# # Fail the tests if there are any warnings.
# error
Expand Down

0 comments on commit 0cd5da7

Please sign in to comment.