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

Exclude untestable code from coverage #2172

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Exclude untestable code from coverage #2172

merged 1 commit into from
Jan 10, 2023

Conversation

sanders41
Copy link
Contributor

@sanders41 sanders41 commented Jan 9, 2023

Closes #

Code Changes

  • Added pragma: no cover to if __name__ == "__main__:" code
  • Excluded migrations from coverage

Steps to Confirm

  • Run pytest tests/ctl -m "unit" and verify migrations and if __name__ == "__main__:" sections are not included in the term-missing section

Pre-Merge Checklist

Description Of Changes

In thinking about #2135 I am adding some exclusions from coverage here. The migrations are used by alembic and not by fides code directly, the only reason we have them in a directory under coverage is so plus can access them.

We could probably jump through some hoops and find a way to test the if __name__ == "__main__:" sections, but doing so would be for the sake of coverage and not meaningful.

Copy link
Contributor

@ThomasLaPiana ThomasLaPiana left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@sanders41 sanders41 merged commit 9df5c1b into main Jan 10, 2023
@sanders41 sanders41 deleted the ps-tests branch January 10, 2023 10:38
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