Skip to content

Commit

Permalink
fixmypy
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-melf committed Oct 13, 2023
1 parent 0ddba65 commit 59dc571
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pytket/extensions/quantinuum/backends/api_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def __init__(
self._cred_store = token_store

if __user_name is not None:
self.config.username = __user_name # type: ignore
if self.config.username is not None and __pwd is not None: # type: ignore
self._cred_store._save_login_credential(self.config.username, __pwd) # type: ignore
self.config.username = __user_name
if self.config.username is not None and __pwd is not None:
self._cred_store._save_login_credential(self.config.username, __pwd)

self.api_version = api_version
self.use_websocket = use_websocket
Expand Down Expand Up @@ -244,7 +244,7 @@ def _refresh_id_token(self, refresh_token: str) -> None:

def _get_credentials(self) -> Tuple[str, str]:
"""Method to ask for user's credentials"""
user_name = self._cred_store._user_name or self.config.username # type: ignore
user_name = self._cred_store._user_name or self.config.username
if not user_name:
user_name = input("Enter your Quantinuum email: ")
pwd = self._cred_store._password
Expand Down
2 changes: 1 addition & 1 deletion pytket/extensions/quantinuum/backends/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ def set_quantinuum_config(username: Optional[str]) -> None:
"""Set default value for Quantinuum username.
Can be overriden in backend construction."""
hconfig = QuantinuumConfig.from_default_config_file()
hconfig.username = username # type: ignore
hconfig.username = username
hconfig.update_default_config_file()
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def fixture_mock_quum_api_handler(
api_handler = QuantinuumAPI()

# Add the credential storage seperately in line with fixture parameters
api_handler.config.username = username # type: ignore
api_handler.config.username = username
api_handler._cred_store = cred_store
api_handler.login()

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_full_login(

api_handler = QuantinuumAPI()
# emulate no pytket config stored email address
api_handler.config.username = None # type: ignore
api_handler.config.username = None
api_handler.full_login()

assert api_handler._cred_store.id_token == mock_token
Expand Down

0 comments on commit 59dc571

Please sign in to comment.