-
Notifications
You must be signed in to change notification settings - Fork 906
Deprecate PymatgenTest
, migrate tests to pytest
from unittest
#4212
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@unittest.expectedFailure | |
def test_library_line_explicit_path(self): | |
gin = self.gio.library_line("/Users/mbkumar/Research/Defects/GulpExe/Libraries/catlow.lib") | |
assert "lib" in gin |
9c5bc6d
to
344a872
Compare
3ffea5d
to
ab8bb0e
Compare
9595a2a
to
9ae0deb
Compare
95a3e90
to
42f9fb6
Compare
@@ -35,8 +35,15 @@ | |||
FAKE_POTCAR_DIR = f"{VASP_IN_DIR}/fake_potcars" | |||
|
|||
|
|||
class PymatgenTest(TestCase): | |||
"""Extends unittest.TestCase with several assert methods for array and str comparison.""" | |||
class MatSciTest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 unittest
PymatgenTest
, 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
pymatgen
tests topytest
, to close [Dev/Test] MigratePymatgenTest
fromunittest.TestCase
topytest
#4202conftest.py
doesn't seem to be used at allPymatgenTest
to avoid accidental breakageWarning
PymatgenTest
withMatSciTest
, set deadline at 2026-01-01setUp
->setup_method
even when not inheriting fromTestCase
Test classes that doesn't subclass
TestCase
and definesetUp
method would work inpytest
, but it's not a native support, so I would still migrate them here: