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

Add __init__.py files to convert the folders to python module. #383

Closed
wants to merge 1 commit into from

Conversation

yegle
Copy link
Collaborator

@yegle yegle commented Sep 6, 2024

Description

This allows one to run pytest in the root folder to trigger all the tests, instead of needing to modify PYTHONPATH environment variable.

Checklist

General

  • Added the correct label
  • Assigned to a specific person or civiform/deployment-system
  • Created tests which fail without the change (if possible)
  • Performed manual testing (at a minimum run bin/setup without your changes and then bin/deploy with your changes to ensure your changes don't break existing deployments)
  • Extended the README / documentation, if necessary

Instructions for manual testing

Local test passes:

(venv) ych@penguin ~/git/cloud-deploy-infra (git)-[pytest-fix]-
$ pytest 
=================================== test session starts ===================================
platform linux -- Python 3.11.2, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/ych/git/cloud-deploy-infra
collected 59 items                                                                        

cloud/aws/bin/pgadmin_test.py ..................                                    [ 30%]
cloud/shared/bin/lib/check_test.py .                                                [ 32%]
cloud/shared/bin/lib/config_loader_test.py ...............                          [ 57%]
cloud/shared/bin/lib/config_parser_test.py ...                                      [ 62%]
cloud/shared/bin/lib/variable_definition_loader_test.py .                           [ 64%]
cloud/shared/bin/lib/write_tfvars_test.py ...                                       [ 69%]
cloud/shared/validate_variable_definitions_test.py ..................               [100%]

=================================== 59 passed in 1.07s ====================================

Issue(s) this completes

This allows one to run `pytest` in the root folder to trigger all the
tests, instead of needing to modify PYTHONPATH environment variable.
@dkatzz dkatzz requested review from a team and avaleske and removed request for a team September 10, 2024 17:30
@@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these newlines intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I recreated this PR in #390 from a branch of this repo instead of my own repo.

I'll fix this in that PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm actually the newline at the end of the file is added by vim automatically per the POSIX standard: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206

@yegle yegle closed this Sep 13, 2024
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