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

Don't let tests pollute the pymatgen repo #3255

Merged
merged 11 commits into from
Aug 19, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Aug 19, 2023

All temporary test files should be written to temporary directories. This PR fixes the worst/most obvious offenders but probably many tests left writing to the current working or module directory.

f94f7a3 delete unused tests/files/chemenv/images/detailed_voronoi_container_coordination_numbers_1.png
bb4f4fa mv tests/files/chemenv/{json_test_files,json} mv tests/files/chemenv/structure_environments{_files,}
dec0193 remove all shutil.rmtree from tests
c3e11d6 pmg test_entrypoint run in tmp_path
7f4bd03 refactor TestVampireCaller
b834872 delete all def setUp(self): warnings.simplefilter("ignore")
e4a84c7 delete questionable def tearDown(self): del self.attrs
a0274db remove all unused unittest.main()

janosh added 8 commits August 18, 2023 18:22
mv tests/files/chemenv/structure_environments{_files,}
and refactor tests to not pollute git directory if necessary
and corresponding
    def tearDown(self):
        warnings.simplefilter("default")
example:
    def tearDown(self):
        del self.ethylene
        del self.butadiene
        del self.cyclohexene

seems pointless, class is garbage-collected anyway
if __name__ == "__main__":
    import unittest

    unittest.main()
@janosh janosh enabled auto-merge (squash) August 19, 2023 01:54
@janosh janosh disabled auto-merge August 19, 2023 15:21
@janosh janosh merged commit b0dc72f into master Aug 19, 2023
@janosh janosh deleted the dont-let-tests-pollute-repo-dir branch August 19, 2023 15:21
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.

1 participant