-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to fix tmp_dir permission failure with test fixture
- Loading branch information
Vasu Jaganath
committed
Jul 9, 2024
1 parent
6efcc8e
commit 7f341eb
Showing
2 changed files
with
16 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
import pytest | ||
from .util import get_data, get_main_output | ||
|
||
from .util import get_data | ||
|
||
|
||
def test_output_2D_file_format() -> None: | ||
@pytest.fixture(scope="session") | ||
def test_output_2d_file_format(tmp_path_factory: pytest.TempPathFactory) -> None: | ||
"""A simple test for format tag fix for 2D output arrays.""" | ||
|
||
Path("filename.txt").touch() | ||
params = [ | ||
sys.executable, | ||
"-m", | ||
"cwltool", | ||
"--cachedir", # just so that the relative path of file works out | ||
"foo", | ||
get_data("tests/output_2D_file_format.cwl"), | ||
] | ||
tmp_path: Path = tmp_path_factory.mktemp("tmp") | ||
# still need to create 'filename.txt' as it is needed in output_2D_file_format.cwl | ||
_ = tmp_path / "filename.txt" | ||
commands = [ | ||
"--cachedir", | ||
str(tmp_path / "foo"), # just so that the relative path of file works out | ||
get_data("tests/output_2D_file_format.cwl")] | ||
|
||
error_code, _, stderr = get_main_output(commands) | ||
|
||
assert subprocess.check_call(params) == 0 | ||
assert error_code == 0, stderr |