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

Refactor and fix tests #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shubham599
Copy link
Contributor

@shubham599 shubham599 commented May 19, 2022

Contributes to #46

What did you do?

Refactored tests:
Now all of the tests are under the 'testing' directory. They are further categorized into 'unit' and 'integration' tests.

Removed duplicate test:
'test_post_headers.py' was actually doing a subset of what 'test_mark.py' was doing - so I've deleted 'test_post_headers.py'

Fixed imports:
I've added 'init.py' files to the project directory, as well as the test directories. This allowed me to import stuff 'the python way' (or rather, 'the fastapi way'), removing the need to add filepaths to the system path variable for imports.

Why did you do it?

Appending filepaths to system path variables is not the ideal way to handle imports. Further, organizing all tests under a single directory helps keep imports clean, and can also be beneficial in CI/CD (we can just call 'pytest' in the GitHub Action that compiles the code, and it will run all the tests itself).

How have you tested it?

Ran pytest on the project directory - all tests are running and succeeding

Were docs updated if needed?

  • No
  • Yes
  • N/A

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new console logs
  • Fixes entire issue
  • Partial fix for issue

Signed-off-by: Shubham Saxena <s.shubham.work@gmail.com>
@github-actions
Copy link

👋 Hi! This pull request has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed in 14 days.

@github-actions github-actions bot added the stale label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant