Skip to content

Commit d1ceb47

Browse files
Fix codefactor errors
1 parent 022ffa0 commit d1ceb47

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

fast_bitrix24/mult_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def get_pbar(self):
117117
return tqdm(
118118
total=(self.real_len or len(self.item_list)), initial=self.real_start
119119
)
120-
else:
121-
return MutePBar()
120+
121+
return MutePBar()
122122

123123

124124
class MutePBar:

fast_bitrix24/srh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ async def request_attempt(self, method, params=None) -> ServerResponse:
145145
except ClientResponseError as error:
146146
if error.status // 100 == 5: # ошибки вида 5XX
147147
raise ServerError("The server returned an error") from error
148-
else:
149-
raise
148+
149+
raise
150150

151151
def success(self):
152152
"""Увеличить счетчик удачных попыток."""

fast_bitrix24/user_request.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ async def make_remaining_requests(self):
162162
def dedup_results(self):
163163
# дедупликация через сериализацию, превращение в set и десериализацию
164164
self.results = (
165-
[pickle.loads(y) for y in {pickle.dumps(x) for x in self.results}]
165+
[
166+
pickle.loads(y) # nosec B301
167+
for y in {pickle.dumps(x) for x in self.results} # nosec B301
168+
]
166169
if self.results
167170
else []
168171
)

fast_bitrix24/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def _url_valid(url):
55
try:
66
result = urlparse(url)
77
return all([result.scheme, result.netloc, result.path])
8-
except:
8+
except Exception:
99
return False
1010

1111

tests/fixtures.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ def get_test():
1010
test_webhook = os.getenv('FAST_BITRIX24_TEST_WEBHOOK')
1111
if test_webhook:
1212
return Bitrix(test_webhook)
13-
else:
14-
raise RuntimeError(
15-
'Environment variable FAST_BITRIX24_TEST_WEBHOOK should be set '
16-
'to the webhook of your test Bitrix24 account.')
13+
14+
raise RuntimeError(
15+
'Environment variable FAST_BITRIX24_TEST_WEBHOOK should be set '
16+
'to the webhook of your test Bitrix24 account.')
1717

1818

1919
@pytest.fixture(scope='session')
2020
def get_test_async():
2121
test_webhook = os.getenv('FAST_BITRIX24_TEST_WEBHOOK')
2222
if test_webhook:
2323
return BitrixAsync(test_webhook)
24-
else:
25-
raise RuntimeError(
26-
'Environment variable FAST_BITRIX24_TEST_WEBHOOK should be set '
27-
'to the webhook of your test Bitrix24 account.')
24+
25+
raise RuntimeError(
26+
'Environment variable FAST_BITRIX24_TEST_WEBHOOK should be set '
27+
'to the webhook of your test Bitrix24 account.')
2828

2929

3030
@pytest.fixture(scope='session')

0 commit comments

Comments
 (0)