Suppress spglib DeprecationWarning during module-level test initialization#287
Conversation
Co-authored-by: briantoby <9433704+briantoby@users.noreply.github.com>
|
@Kvieta1990 The self-test after build of the self-installers is now failing (see here). My understanding is that seekpath calls spglib in a way that is deprecated which generates a warning and that warning crashes the self-test. We got this warning before but it did not crash the test. I suspect that we have now gone from spglib 2.6.0 to 2.7.0 and the severity of the warning has been stepped up and now the self-test fails. I brought this up in September as a seekpath issue (materialscloud-org/seekpath#112) and heard that this has apparently was already resolved in their development branch, but they still have not put out an updated release. Are you OK with this change to suppress the warning for now? |
|
Hi Brian, I am Ok with the suppression at this moment so please feel free to move forward. I will grab the new codes and test out manually on my side to make sure nothing is broken and things are still working properly. If things are changed, I will submit new issues which I will be working on to solve. Does this sound like a plan? Thank you! |
pytest's
filterwarnings = ["error"]configuration causes test collection to fail when spglib emits "Set OLD_ERROR_HANDLING to false" DeprecationWarning during module-levelkVectorinitialization intest_kvec.py.Changes
kVectorinitialization withwarnings.catch_warnings()context managerimport warningsto support the context managerThe existing
@pytest.mark.filterwarnings("ignore::DeprecationWarning")decorators on test functions handle warnings during test execution but don't affect module-level code that runs during collection.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.