Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

job.files: raise FileNotFoundError rather than AttributeError or KeyError #1329

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

jan-janssen
Copy link
Member

No description provided.

@jan-janssen jan-janssen requested a review from pmrv February 14, 2024 08:52
jan-janssen added a commit to pyiron/pyiron_atomistics that referenced this pull request Feb 14, 2024
@jan-janssen
Copy link
Member Author

======================================================================
ERROR: test_job_files (flex.test_executablecontainer.TestExecutableContainer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/jobs/job/extension/files.py", line 104, in __getattr__
    return self[self._get_file_dict()[item]]
KeyError: '__dict__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/pyiron_base/pyiron_base/tests/flex/test_executablecontainer.py", line 97, in test_job_files
    self.assertTrue(file in dir(job.files))
  File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/jobs/job/extension/files.py", line 58, in __dir__
    return list(self._get_file_dict().keys()) + super().__dir__()
  File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/jobs/job/extension/files.py", line 106, in __getattr__
    raise FileNotFoundError(item)
FileNotFoundError: __dict__

----------------------------------------------------------------------

Copy link
Member

@niklassiemer niklassiemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@pmrv pmrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but generally lgtm.

@jan-janssen jan-janssen merged commit 43d5c0f into main Feb 14, 2024
25 checks passed
@jan-janssen jan-janssen deleted the files_raise_filenotfounderror branch February 14, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants