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

Refactor settings #449

Merged
merged 13 commits into from Sep 24, 2021
Merged

Refactor settings #449

merged 13 commits into from Sep 24, 2021

Conversation

liamhuber
Copy link
Member

Just some minor housekeeping for readability

@liamhuber
Copy link
Member Author

On my local machine the install test needs os.remove(os.path.join(execution_path, "pyiron.log")) in TearDownClass or I get a pyiron.log leftover in the test directory. But on the CI this gives

FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/pyiron_base/pyiron_base/tests/settings/pyiron.log'

For now I just wrapped the removal in a try/except FileNotFoundError because I want to keep my system clean, but I'd feel better understanding where pyiron.log winds up on the CI system if not at execution_path...

Comment on lines -56 to -57
if __name__ == "__main__":
unittest.main()
Copy link
Member

Choose a reason for hiding this comment

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

Why is this part removed? I though we need it to run the tests in the continuous integration environment.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a very good warning!!! It's not necessary on my local machine so I thought I was removing dead code. I'll just burn some CPU minutes and do a brute-force tests by throwing a failing test in one of these suites to see if the CI catches it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it's safe to remove the __main__ boilerplate. I added this to one of the modules that had had the boilerplate stripped and the CI caught it no problem:

    def test_should_fail(self):
        self.assertTrue(False)

I'm going to revert the change and resolve the other two instances, but it was a very good call to double check this behaviour!!!

@liamhuber liamhuber merged commit e6c9d00 into master Sep 24, 2021
@delete-merged-branch delete-merged-branch bot deleted the refactor_settings branch September 24, 2021 07:20
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.

None yet

3 participants