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

Change of error type in test_file_not_found #156

Closed
merkys opened this issue Nov 10, 2021 · 2 comments
Closed

Change of error type in test_file_not_found #156

merkys opened this issue Nov 10, 2021 · 2 comments

Comments

@merkys
Copy link

merkys commented Nov 10, 2021

I am building and testing gemmi v0.5.0 for Debian using system-provided pegtl (v2.8.3-3). I am getting the following test failure:

==================================================================================================== FAILURES =====================================================================================================
__________________________________________________________________________________________ TestBlock.test_file_not_found __________________________________________________________________________________________

self = <test_cif.TestBlock testMethod=test_file_not_found>

    def test_file_not_found(self):
        with self.assertRaises(IOError):
>           cif.read('file-that-does-not-exist.cif')
E           RuntimeError: pegtl: unable to open() file file-that-does-not-exist.cif for reading errno 2

tests/test_cif.py:244: RuntimeError
============================================================================================= short test summary info =============================================================================================
FAILED tests/test_cif.py::TestBlock::test_file_not_found - RuntimeError: pegtl: unable to open() file file-that-does-not-exist.cif for reading errno 2
==================================================================================== 1 failed, 135 passed, 10 skipped in 1.17s ====================================================================================

If I replace with self.assertRaises(IOError): with with self.assertRaises(RuntimeError):, the test passes. I am not sure, though, that this is not error masking.

This issue may as well be caused by using pegtl of other version than shipped with gemmi. If so, please ignore this report.

@wojdyr
Copy link
Member

wojdyr commented Nov 10, 2021

This exception type was changed in response to #119.
It included a small change in PEGTL in 8e0a2cd
so I'm afraid that PEGTL in gemmi is now not fully compatible with the original PEGTL.

@wojdyr wojdyr closed this as completed Nov 10, 2021
@merkys
Copy link
Author

merkys commented Nov 10, 2021

I see, thanks for the explanation. A comment in 8e0a2cd says that pegtl v3 has changed the way it issues errors, and the change to the shipped pegtl is its partial backport. It would be interesting to try building with the original pegtl v3 when it becomes available in Debian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants