-
Notifications
You must be signed in to change notification settings - Fork 61
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
Test default backend loading #1425
Conversation
The first commit introduces the failing test, the second one the fix. @chmwzc: could you also check that is working for you locally? I'm pretty sure, because I managed to reproduce the error, but I learned that one check more is never wasted, and environments issues may be tricky... |
Ok, for some reason, I screwed another test. I will fix it, but the one I added is actually passing (and it was not in the commit in which it was introduced), so keep going with the review. |
I slightly changed the solution approach, providing a custom error. The rationale is that from the point of view of At the same time, I didn't want to catch whatever |
The problem is slightly more complicated than expected: two different errors were raised qibo/src/qibo/backends/__init__.py Lines 230 to 235 in 0796910
(as they are again, with MissingBackend )
This seems to have been almost purposeful. Or, at least, it is exploited in the tests. I'm not sure it's a great idea to distinguish the two cases in general, because you also don't care that much to distinguish the reason, as a user. So, you'd like to receive the same error in both cases, most probably (even losing the hint about the package installation). Well, we could even change the For the time being, the quickfix should work just for the issue described (catching both types of errors only during default backend creation). |
Apparently now there is a problem with the fixture, that is working on Mac, but making I will try to debug locally on Linux... |
It seems I pushed too much with the test, since now I have a problem in the CI (not on MacOS) I can not reproduce locally (neither on Linux nor on MacOS itself). There is also a residual "earnest" issue to address, that I'm detecting even locally (about I'm trying to debug the issue, but whenever the CI is involved it could be a pain... |
Since qibojit is always installed in the CI, we have to temporarily remove it manually, and restore after the test.
I can confirm that this works for me as well, locally on linux. |
There is an error mismatch, but this was undetected in the CI, because Qibojit is always available.
Checklist: