style(whole-project): fixing linting and typing errors

This commit is contained in:
Gergő Jedlicska
2022-12-20 10:45:22 +01:00
parent b25f2ab4bc
commit 990cf4eb2f
41 changed files with 505 additions and 236 deletions
+6 -5
View File
@@ -1,11 +1,11 @@
import json
from pathlib import Path
from typing import Generator, Iterable
import pytest
from specklepy.api.wrapper import StreamWrapper
from specklepy.paths import accounts_path
from specklepy.transports.sqlite import SQLiteTransport
def test_parse_stream():
@@ -60,7 +60,8 @@ def test_parse_globals_as_commit():
assert wrap.type == "commit"
#! NOTE: the following three tests may not pass locally if you have a `speckle.xyz` account in manager
#! NOTE: the following three tests may not pass locally
# if you have a `speckle.xyz` account in manager
def test_get_client_without_auth():
wrap = StreamWrapper("https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
client = wrap.get_client()
@@ -88,16 +89,16 @@ def test_get_transport_with_token():
@pytest.fixture
def user_path() -> Path:
def user_path() -> Iterable[Path]:
path = accounts_path().joinpath("test_acc.json")
# hey, py37 doesn't support the missing_ok argument
try:
path.unlink()
except:
except Exception:
pass
try:
path.unlink(missing_ok=True)
except:
except Exception:
pass
path.parent.absolute().mkdir(exist_ok=True)
yield path