Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/psij/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def _get_ips(self) -> List[str]:
return r

def _create_update_file(self) -> None:
self.work_directory.mkdir(parents=True, exist_ok=True)
f = tempfile.NamedTemporaryFile(dir=self.work_directory, prefix='supd_', delete=False)
name = f.name
self.update_file_name = name
Expand Down
16 changes: 16 additions & 0 deletions tests/test_status_updater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import site
import subprocess
import sys
from pathlib import Path


def test_a_batch_executor_starts_in_a_home_without_psij_directory(tmp_path: Path) -> None:
p = subprocess.run([sys.executable, '-c',
'from psij import JobExecutor; JobExecutor.get_instance("slurm")'],
env={**os.environ, 'HOME': str(tmp_path),
'PYTHONUSERBASE': site.getuserbase()},
capture_output=True, text=True)

assert p.returncode == 0, p.stderr
assert (tmp_path / '.psij').is_dir()
Loading