Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧪💅 Eliminate blanket # noqa comments #36

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

djyasin
Copy link
Member

@djyasin djyasin commented Sep 13, 2024

This PR is to address the changes needed for python-check-blanket-noqa.

@djyasin djyasin changed the title Add changes for noqa [WIP]Add changes for noqa Sep 13, 2024
Comment on lines 140 to 152
def test_dsv_import(self) -> None:
from awx_plugins.credentials.dsv import SecretsVault # noqa: F401

# assert this module as opposed to older thycotic.secrets.vault
assert SecretsVault.__module__ == 'delinea.secrets.vault'

def test_tss_import(self):
from awx_plugins.credentials.tss import DomainPasswordGrantAuthorizer, PasswordGrantAuthorizer, SecretServer, ServerSecret # noqa
from awx_plugins.credentials.tss import ( # noqa: F401
DomainPasswordGrantAuthorizer,
PasswordGrantAuthorizer,
SecretServer,
ServerSecret,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrismeyersfsu do these tests actually make sense in this form with in-function imports? Other smoke tests already import them, so that would influence the in-process module cache anyway.

def test_dsv_import(self):
from awx_plugins.credentials.dsv import SecretsVault # noqa
def test_dsv_import(self) -> None:
from awx_plugins.credentials.dsv import SecretsVault # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djyasin so the best action here is to try to actually fix the underlying problem. I wonder if it's okay for us to do a pytest.importorskip() (if this test is even needed / cc @chrismeyersfsu).

If that's not acceptable for some reason, let's keep it as it is in your current patch.

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djyasin so since https://github.com/ansible/awx-plugins/actions/runs/10854294898/job/30125329367?pr=36 is green, this job needs to be removed and the check re-integrated into the unified pre-commit one.

More specifically, this means that the following bits should be removed: https://github.com/ansible/awx-plugins/blob/96fdebc/.github/workflows/ci-cd.yml#L616-L622 / https://github.com/ansible/awx-plugins/blob/96fdebc/.github/workflows/ci-cd.yml#L608C34-L608C60.

@webknjaz webknjaz self-assigned this Sep 17, 2024
@webknjaz webknjaz changed the title [WIP]Add changes for noqa 🧪💅 Eliminate blanket # noqa comments Sep 17, 2024
@webknjaz webknjaz marked this pull request as ready for review September 17, 2024 22:28
@webknjaz webknjaz added this pull request to the merge queue Sep 17, 2024
Merged via the queue into ansible:devel with commit a606b1c Sep 17, 2024
30 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants