Skip to content

Don't let tests pollute the pymatgen repo - #3255

Merged
janosh merged 11 commits into
masterfrom
dont-let-tests-pollute-repo-dir
Aug 19, 2023
Merged

janosh merged 11 commits into
masterfrom
dont-let-tests-pollute-repo-dir

Conversation

@janosh

@janosh janosh commented Aug 19, 2023

Copy link
Copy Markdown
Member

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