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

Moved ENABLE_CONTRACT_CHECKING to the top of new_setattr #932

Conversation

Bruce-8
Copy link
Contributor

@Bruce-8 Bruce-8 commented Jul 27, 2023

Motivation and Context

This pull request is made so that any contract or type checks are not executed if ENABLE_CONTRACT_CHECKING is False.

Your Changes

Description: Moved the check for ENABLE_CONTRACT_CHECKING to the top of the function so that the new_setattr function doesn't execute any contract or type checks if the constant is False.

Type of change (select all that apply):

  • Breaking change (fix or feature that would cause existing functionality to change)

Testing

  • Added test case to ensure that no error is raised if a type check is violated (in the case that ENABLE_CONTRACT_CHECKING is set to False).

Questions and Comments (if applicable)

Checklist

  • I have performed a self-review of my own code.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported on Coveralls.
  • I have added tests for my changes.
  • I have updated the CHANGELOG.md file.

@Bruce-8 Bruce-8 changed the title Moved ENABLE_CONTRACT_CHECKING to the top of new_setattr Moved ENABLE_CONTRACT_CHECKING to the top of new_setattr Jul 27, 2023
@coveralls
Copy link
Collaborator

coveralls commented Jul 27, 2023

Pull Request Test Coverage Report for Build 5686178850

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 94.448%

Totals Coverage Status
Change from base Build 5683506524: 0.005%
Covered Lines: 3266
Relevant Lines: 3458

💛 - Coveralls

@david-yz-liu david-yz-liu merged commit 97746f7 into pyta-uoft:master Jul 28, 2023
5 checks passed
@Bruce-8 Bruce-8 deleted the move-ENABLE_CONTRACT_CHECKING-to-top-of-new_setattr branch July 28, 2023 23:55
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.

3 participants