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
2 changes: 1 addition & 1 deletion src/psij/_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _register_plugin(desc: Descriptor, root_path: str, type: str,
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod) # type: ignore
cls = getattr(mod, cls_name)
cls.__psij_file__ = mod_path # type: ignore
cls.__psij_file__ = mod_path
except Exception as ex:
s = str(ex)
logger.info(s)
Expand Down
2 changes: 1 addition & 1 deletion src/psij/job_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(self, executable: Optional[str] = None, arguments: Optional[List[st
# care of the conversion, but mypy gets confused
self._directory = _to_path(directory)
self.inherit_environment = inherit_environment
self.environment = _to_env_dict(environment)
self._environment = _to_env_dict(environment)
self._stdin_path = _to_path(stdin_path)
self._stdout_path = _to_path(stdout_path)
self._stderr_path = _to_path(stderr_path)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_env_var(execparams: ExecutorTestParams) -> None:
arguments=['-c', 'env > /tmp/t; echo -n $TEST_VAR$TEST_INT'],
stdout_path=outp))
assert job.spec is not None
job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'} # type: ignore
job.spec.environment = {'TEST_INT': 1, 'TEST_VAR': '_y_'}
ex = _get_executor_instance(execparams, job)
ex.submit(job)
status = job.wait(timeout=_get_timeout(execparams))
Expand Down
6 changes: 4 additions & 2 deletions tests/test_job_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def test_environment_types() -> None:
assert spec.environment is None

spec = JobSpec(environment={'foo': 'bar'})
assert spec.environment['foo'] == 'bar' # type: ignore
assert spec.environment is not None
assert spec.environment['foo'] == 'bar'

spec = JobSpec()
spec.environment = {'foo': 'bar'}
assert spec.environment is not None
assert spec.environment['foo'] == 'bar'

spec.environment = {'foo': 'biz', 'bar': 42} # type: ignore
spec.environment = {'foo': 'biz', 'bar': 42}
assert spec.environment['foo'] == 'biz'
assert spec.environment['bar'] == '42'

Expand Down
Loading