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

Use a consistent Python test module naming pattern #2039

Closed
sarayourfriend opened this issue May 5, 2023 · 3 comments · Fixed by #2051
Closed

Use a consistent Python test module naming pattern #2039

sarayourfriend opened this issue May 5, 2023 · 3 comments · Fixed by #2051
Assignees
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users good first issue New-contributor friendly help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: api Related to the Django API 🧱 stack: catalog Related to the catalog and Airflow DAGs

Comments

@sarayourfriend
Copy link
Collaborator

Current Situation

Tests in the catalog are named test_{module}.py whereas tests in the API are named {module}_test.py.

Suggested Improvement

It'd be nice to have a single, consistent pattern for naming test modules. My vote is to move everything to the catalog pattern as across both test suites we use the pattern test_{description} for test functions.

Benefit

Using a consistent pattern for test module names across all Python tests would reduce the cognitive load when creating new test modules.

Using the same pattern for test modules and test functions further reduces that cognitive load (only one pattern to remember).

@sarayourfriend sarayourfriend added good first issue New-contributor friendly 🟩 priority: low Low priority and doesn't need to be rushed 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: api Related to the Django API 🧱 stack: catalog Related to the catalog and Airflow DAGs labels May 5, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog May 5, 2023
@dhruvkb dhruvkb added the help wanted Open to participation from the community label May 5, 2023
@harsitagarwalla187
Copy link
Contributor

@sarayourfriend Do i have to change the naming convention of the files in api/test to test_{module}.py ?

@sarayourfriend
Copy link
Collaborator Author

Yup, that's it 🙂. If you'd like to work on this, leave a comment and I will assign it to you.

@harsitagarwalla187
Copy link
Contributor

@sarayourfriend Assign it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users good first issue New-contributor friendly help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: api Related to the Django API 🧱 stack: catalog Related to the catalog and Airflow DAGs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants