Deprecate PymatgenTest, migrate tests to pytest from unittest#4212
Conversation
This reverts commit 6f95ba8.
| def test_specie_potential(self): | ||
| pass | ||
|
|
||
| @unittest.expectedFailure |
There was a problem hiding this comment.
I might remove this test as it is hard-coded to check the content of a non-existent file:
pymatgen/tests/command_line/test_gulp_caller.py
Lines 139 to 142 in 31f1e1f
9c5bc6d to
344a872
Compare
3ffea5d to
ab8bb0e
Compare
9595a2a to
9ae0deb
Compare
95a3e90 to
42f9fb6
Compare
|
|
||
| class PymatgenTest(TestCase): | ||
| """Extends unittest.TestCase with several assert methods for array and str comparison.""" | ||
| class MatSciTest: |
There was a problem hiding this comment.
I originally didn't plan to deprecate PymatgenTest in this PR, but it turns out we have to do this here, otherwise tests that subclassing PymatgenTest would still rely on the TestCase and pytest methods like setup_method/class would not be compatible, meaning we have to do another migration after PymatgenTest dropped TestCase inheritance.
So I guess the easiest way is not to drop inheriting TestCase by PymatgenTest, but replacing PymatgenTest with another one that doesn't subclassing TestCase.
I drafted a name here but free feel to comment if you have better ideas (batch rename would be super easy with an IDE so don't worry).
71dd429 to
def9886
Compare
…grate-pmg-tests-to-pytest
…grate-pmg-tests-to-pytest
…grate-pmg-tests-to-pytest
Signed-off-by: Haoyu (Daniel) YANG <yanghaoyu97@outlook.com>
PymatgenTest, migrate pymatgen tests to pytest from unittestPymatgenTest, migrate tests to pytest from unittest
…grate-pmg-tests-to-pytest
|
There seems to be conflicts that need to be adjusted. |
…al-real-real-migrate-pmg-tests-to-pytest
|
Fixed, thanks for reviewing. Looks like COD might be temporarily down thus the failure |
…al-real-real-migrate-pmg-tests-to-pytest
Head branch was pushed to by a user without write access
|
@shyuep Can you maybe review this? Merge conflicts solved. Thanks. |
|
Thanks |
Summary
pymatgentests topytest, to close [Dev/Test] MigratePymatgenTestfromunittest.TestCasetopytest#4202conftest.pydoesn't seem to be used at allPymatgenTestto avoid accidental breakageWarning
PymatgenTestwithMatSciTest, set deadline at 2026-01-01setUp->setup_methodeven when not inheriting fromTestCaseTest classes that doesn't subclass
TestCaseand definesetUpmethod would work inpytest, but it's not a native support, so I would still migrate them here: