Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 11, 2024
1 parent cdb7a73 commit f3267e5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/perun/api/test_decorator.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
from perun.api.decorator import monitor, perun, register_callback
from perun.data_model.data import DataNode
import subprocess
import time
import perun
from pathlib import Path

import pytest

from pathlib import Path

import subprocess
import perun
from perun.api.decorator import monitor, perun, register_callback
from perun.data_model.data import DataNode


def test_perun_cli(tmp_path: Path):
# Test case for perun decorator
# Add your test logic here

testFilePath = Path("./tests/scripts/sleep_decorated.py")
resultsPath = tmp_path / "results/"
resultsPath = tmp_path / "results/"

subprocess.run(
f"PERUN_DATA_OUT={str(resultsPath)} python {testFilePath}".split(" "), timeout=20
f"PERUN_DATA_OUT={str(resultsPath)} python {testFilePath}".split(" "),
timeout=20,
)

# Expected files, hdf5 file and a text file with a date
Expand All @@ -33,6 +33,7 @@ def test_perun_cli(tmp_path: Path):
assert textFile.is_file()
assert textFile.suffix == ".txt"


def test_perun_decorator(tmp_path: Path):

results_path = tmp_path / "results"
Expand All @@ -43,7 +44,7 @@ def perun_sleep(secs: int):

# Run function
perun_sleep(10)

# Expected files, hdf5 file and a text file with a date
# Are the files in the correct folder
resultFiles = list(results_path.iterdir())
Expand Down

0 comments on commit f3267e5

Please sign in to comment.