qiboteam / qibo-client

Qibo remote connection client.
https://qibo.science
Apache License 2.0
1 stars 0 forks source link

Postpone environment evaluation #30

Closed alecandido closed 3 months ago

alecandido commented 4 months ago

At the moment, I shifted this to the Client() instantiation.

It could be better to pass down the callable, and only retrieve the URL during the request. I didn't do it, because there might be a point in having a consistent Client, during its whole lifetime (though I'm not sure...).

Closes #29

alecandido commented 4 months ago

Btw, you're mixing unittest and pytest, that are two separate testing frameworks.

https://github.com/qiboteam/qibo-client/blob/4e70c049bb66475d9af468fe3e9611d75fd5e5fb/tests/test_tii.py#L1 (and Pytest is the runner).

I'd suggest using https://docs.pytest.org/en/latest/how-to/monkeypatch.html

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (e56ba17) to head (1d25cb5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #30 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 6 6 Lines 121 125 +4 ========================================= + Hits 121 125 +4 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo-client/pull/30/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qiboteam/qibo-client/pull/30/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `100.00% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alecandido commented 4 months ago

This is fine by me, even though from a practical perspective it is very unlikely that we will need this feature when we will have a stable setup.

Hopefully true, but it could happen that someone wants to patch the port after import (that almost always happens top-level). True that, since the port is fixed server-side, there should be no reason to patch the provider. But it is also useful as a blueprint for other ones (and it should not be harmful).

marcorossi5 commented 3 months ago

Btw, you're mixing unittest and pytest, that are two separate testing frameworks.

https://github.com/qiboteam/qibo-client/blob/4e70c049bb66475d9af468fe3e9611d75fd5e5fb/tests/test_tii.py#L1

(and Pytest is the runner). I'd suggest using https://docs.pytest.org/en/latest/how-to/monkeypatch.html

Let's merge for the moment and open a refactoring issue about that.