Skip to content

Commit

Permalink
[Code Quality] Ignore bandit rules B036 and B038.
Browse files Browse the repository at this point in the history
Signed-off-by: Giacomo Marciani <[email protected]>
  • Loading branch information
gmarciani committed Jan 16, 2024
1 parent c0c3184 commit 40f5bd7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cli/tests/pcluster/models/test_cluster_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_initialization_success(self, mock_head_node, filters, expected_filters_
logs_filters = ClusterLogsFiltersParser(mock_head_node, filters)

for attr in expected_attrs:
assert_that(getattr(logs_filters, attr)).is_equal_to(expected_attrs.get(attr))
assert_that(getattr(logs_filters, attr)).is_equal_to(expected_attrs.get(attr)) # noqa: B038
assert_that(expected_filters_size).is_equal_to(len(logs_filters.filters_list))

@pytest.mark.parametrize(
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_initialization_success(self, mock_head_node, params, expected_attrs):
)

for attr in expected_attrs:
assert_that(getattr(export_logs_filters, attr)).is_equal_to(expected_attrs.get(attr))
assert_that(getattr(export_logs_filters, attr)).is_equal_to(expected_attrs.get(attr)) # noqa: B038

@pytest.mark.parametrize(
"attrs, event_in_window, expected_error",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/pcluster/models/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_initialization_success(self, params, expected_attrs):
)

for attr in expected_attrs:
assert_that(getattr(export_logs_filters, attr)).is_equal_to(expected_attrs.get(attr))
assert_that(getattr(export_logs_filters, attr)).is_equal_to(expected_attrs.get(attr)) # noqa: B038

@pytest.mark.parametrize(
"attrs, event_in_window, log_stream_prefix, expected_error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def generate_plots(datadir, outdir, configurations, nodes):
# Box Plots
box_plots = {}
for configuration in configurations:
positions = all_positions[configurations.index(configuration) :: n_configurations] # noqa: E203
positions = all_positions[configurations.index(configuration) :: n_configurations] # noqa: E203, B038
box_plots[configuration] = ax.boxplot(
data[configuration],
patch_artist=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-tests/tests/storage/snapshots_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _open_ssh_connection(self):
)
ssh_conn.open()
tries = 0
except BaseException:
except BaseException: # noqa: B036

Check notice

Code scanning / CodeQL

Except block handles 'BaseException' Note test

Except block directly handles BaseException.
logging.info("SSH connection error - retrying...")
tries -= 1
time.sleep(20)
Expand Down

0 comments on commit 40f5bd7

Please sign in to comment.