Skip to content

Commit 63abcb0

Browse files
committed
Tidy advisor-coverage bootstrap security tests
- Drop blank lines between the two imports in the token-mint tests - Merge nested with-blocks in the stale-token refresh test into one Signed-off-by: Jean Schmidt <contato@jschmidt.me>
1 parent bc3dd7c commit 63abcb0

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

aws/lambda/pytorch-advisor-coverage/advisor_coverage/tests/test_advisor_coverage.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,6 @@ def test_configure_logging_pins_secret_loggers(self):
868868
@patch("advisor_coverage.bootstrap.github.GithubIntegration")
869869
def test_mint_scopes_token_to_actions_write(self, mock_integration):
870870
import github
871-
872871
from advisor_coverage.bootstrap import _mint_scoped_installation_auth
873872

874873
get_token = mock_integration.return_value.get_access_token
@@ -885,7 +884,6 @@ def test_mint_scopes_token_to_actions_write(self, mock_integration):
885884
@patch("advisor_coverage.bootstrap.github.GithubIntegration")
886885
def test_mint_failure_names_the_identifiers(self, mock_integration):
887886
import github
888-
889887
from advisor_coverage.bootstrap import _mint_scoped_installation_auth
890888

891889
mock_integration.return_value.get_access_token.side_effect = (
@@ -951,9 +949,8 @@ def test_dispatch_checks_token_freshness(self):
951949
reds = [make_red(job_name="j / t", observed="o1")]
952950
with patch(
953951
"advisor_coverage.dispatcher.refresh_dispatch_token_if_stale"
954-
) as refresh:
955-
with _DispatchHarness(reds, config=make_config(dry_run=False)) as h:
956-
h.dispatcher.dispatch_for_window(T(0), T(59))
952+
) as refresh, _DispatchHarness(reds, config=make_config(dry_run=False)) as h:
953+
h.dispatcher.dispatch_for_window(T(0), T(59))
957954
refresh.assert_called_once_with()
958955

959956
def test_setup_clients_uses_scoped_token(self):

0 commit comments

Comments
 (0)