Skip to content

Commit 41eb3a5

Browse files
committed
tests: don't capture stdout if it won't be used
May help test timeout on Travis Arm64 experienced by conda
1 parent 122fd5d commit 41eb3a5

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

schema_salad/tests/test_examples.py

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from io import StringIO
55
from typing import Any, Dict, cast
66

7-
from pytest import CaptureFixture
87
from ruamel.yaml.comments import CommentedMap, CommentedSeq
98

109
import schema_salad.main
@@ -47,79 +46,65 @@ def test_self_validate() -> None:
4746
assert 0 == schema_salad.main.main(argsl=[path, path])
4847

4948

50-
def test_print_rdf(capfdbinary: CaptureFixture[bytes]) -> None:
49+
def test_print_rdf() -> None:
5150
"""Test --print-rdf."""
5251
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
5352
document_path = get_data("tests/test_real_cwl/bio-cwl-tools/bamtools_stats.cwl")
5453
assert schema_path and document_path
5554
assert 0 == schema_salad.main.main(
5655
argsl=["--print-rdf", schema_path, document_path]
5756
)
58-
captured = capfdbinary.readouterr()
59-
assert captured.out
6057

6158

62-
def test_print_pre_schema(capfdbinary: CaptureFixture[bytes]) -> None:
59+
def test_print_pre_schema() -> None:
6360
"""Test --print-pre only schema."""
6461
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
6562
assert schema_path
6663
assert 0 == schema_salad.main.main(argsl=["--print-pre", schema_path])
67-
captured = capfdbinary.readouterr()
68-
assert captured.out
6964

7065

71-
def test_print_pre(capfdbinary: CaptureFixture[bytes]) -> None:
66+
def test_print_pre() -> None:
7267
"""Test --print-pre."""
7368
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
7469
document_path = get_data("tests/test_real_cwl/bio-cwl-tools/bamtools_stats.cwl")
7570
assert schema_path and document_path
7671
assert 0 == schema_salad.main.main(
7772
argsl=["--print-pre", schema_path, document_path]
7873
)
79-
captured = capfdbinary.readouterr()
80-
assert captured.out
8174

8275

83-
def test_print_schema_index(capfdbinary: CaptureFixture[bytes]) -> None:
76+
def test_print_schema_index() -> None:
8477
"""Test --print-index only with a schema."""
8578
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
8679
assert schema_path
8780
assert 0 == schema_salad.main.main(argsl=["--print-index", schema_path])
88-
captured = capfdbinary.readouterr()
89-
assert captured.out
9081

9182

92-
def test_print_index(capfdbinary: CaptureFixture[bytes]) -> None:
83+
def test_print_index() -> None:
9384
"""Test --print-index."""
9485
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
9586
document_path = get_data("tests/test_real_cwl/bio-cwl-tools/bamtools_stats.cwl")
9687
assert schema_path and document_path
9788
assert 0 == schema_salad.main.main(
9889
argsl=["--print-index", schema_path, document_path]
9990
)
100-
captured = capfdbinary.readouterr()
101-
assert captured.out
10291

10392

104-
def test_print_schema_metadata(capfdbinary: CaptureFixture[bytes]) -> None:
93+
def test_print_schema_metadata() -> None:
10594
"""Test --print-metadata only for a schema."""
10695
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
10796
assert schema_path
10897
assert 0 == schema_salad.main.main(argsl=["--print-metadata", schema_path])
109-
captured = capfdbinary.readouterr()
110-
assert captured.out
11198

11299

113-
def test_print_metadata(capfdbinary: CaptureFixture[bytes]) -> None:
100+
def test_print_metadata() -> None:
114101
"""Test --print-metadata."""
115102
schema_path = get_data("tests/test_schema/CommonWorkflowLanguage.yml")
116103
document_path = get_data("tests/test_real_cwl/bio-cwl-tools/bamtools_stats.cwl")
117104
assert schema_path and document_path
118105
assert 0 == schema_salad.main.main(
119106
argsl=["--print-metadata", schema_path, document_path]
120107
)
121-
captured = capfdbinary.readouterr()
122-
assert captured.out
123108

124109

125110
def test_schema_salad_doc_oneline_doc() -> None:

0 commit comments

Comments
 (0)