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

test: add more tests to analytics settings and scheduling #1209

Open
wants to merge 1 commit into
base: feature/analytics
Choose a base branch
from

Conversation

bzwei
Copy link
Collaborator

@bzwei bzwei commented Feb 10, 2025

AAP-39884 Test and improve code coverage for analytics collection feature

AAP-39884 Test and improve code coverage for analytics collection feature
@bzwei bzwei requested a review from a team as a code owner February 10, 2025 13:41
headers={"X-ANSIBLE-SERVICE-AUTH": token},
verify=settings.RESOURCE_SERVER["VALIDATE_HTTPS"],
)
except Exception as e:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to catch a generic exception?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ideally I should catch any error from requests.exception.*, there are too many types in this module.

Copy link
Collaborator

Choose a reason for hiding this comment

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

to catch any exception from requests I think you can just catch RequestException which is parent of the rest.
https://github.com/psf/requests/blob/main/src/requests/exceptions.py#L12

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