Skip to content

Commit 4990df8

Browse files
committed
optionally skip tests requiring biopython
1 parent 729c51a commit 4990df8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_basics.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_by_hand(tmpdir):
5454

5555

5656
def test_from_genbank(tmpdir):
57+
pytest.importorskip('Bio')
5758
graphic_record = BiopythonTranslator().translate_record(example_genbank)
5859
assert len(graphic_record.features) == 11
5960
ax, _ = graphic_record.plot(figure_width=10)
@@ -63,13 +64,15 @@ def test_from_genbank(tmpdir):
6364

6465

6566
def test_from_record(tmpdir):
67+
pytest.importorskip('Bio')
6668
record = load_record(example_genbank)
6769
annotate_biopython_record(record, label="bla", color="blue")
6870
graphic_record = BiopythonTranslator().translate_record(record)
6971
assert len(graphic_record.features) == 12
7072

7173

7274
def test_from_genbank_to_circular(tmpdir):
75+
pytest.importorskip('Bio')
7376
translator = BiopythonTranslator()
7477
graphic_record = translator.translate_record(
7578
example_genbank, record_class=CircularGraphicRecord
@@ -202,6 +205,7 @@ def test_cropping_on_the_edge():
202205

203206

204207
def test_to_biopython_record():
208+
pytest.importorskip('Bio')
205209
record = GraphicRecord(
206210
sequence_length=50,
207211
features=[
@@ -239,6 +243,7 @@ def test_sequence_and_translation_plotting():
239243

240244

241245
def test_BlackBoxlessLabelTranslator(tmpdir):
246+
pytest.importorskip('Bio')
242247
translator = BlackBoxlessLabelTranslator()
243248
graphic_record = translator.translate_record(example_genbank)
244249
assert len(graphic_record.features) == 11
@@ -256,7 +261,7 @@ def test_gff():
256261

257262

258263
def test_multiline_plot():
259-
264+
pytest.importorskip('Bio')
260265
translator = BiopythonTranslator()
261266
graphic_record = translator.translate_record(example_genbank)
262267
subrecord = graphic_record.crop((1700, 2200))
@@ -267,6 +272,7 @@ def test_multiline_plot():
267272

268273

269274
def test_multipage_plot(tmpdir):
275+
pytest.importorskip('Bio')
270276
translator = BiopythonTranslator()
271277
graphic_record = translator.translate_record(example_genbank)
272278
subrecord = graphic_record.crop((1800, 2750))
@@ -279,6 +285,7 @@ def test_multipage_plot(tmpdir):
279285

280286

281287
def test_multipage_plot_with_translation(tmpdir):
288+
pytest.importorskip('Bio')
282289
# Github issue 61
283290
translator = BiopythonTranslator()
284291
graphic_record = translator.translate_record(example_genbank)
@@ -298,6 +305,7 @@ def test_multipage_plot_with_translation(tmpdir):
298305

299306

300307
def test_legend():
308+
pytest.importorskip('Bio')
301309
class CustomTranslator(BiopythonTranslator):
302310
def compute_feature_legend_text(self, feature):
303311
return feature.type

0 commit comments

Comments
 (0)