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: Refactored test_assertions.py file. #23584

Merged
merged 8 commits into from
Sep 27, 2023

Conversation

Sai-Suraj-27
Copy link
Contributor

@Sai-Suraj-27 Sai-Suraj-27 commented Sep 14, 2023

PR Description

Refactored test_assertions.py file. Used with when opening files to ensure closure, as opening files in this way is more concise, and also ensures that the call to file.close() is not skipped if there is an exception. Also, removed unnecessary calls to .keys() when iterating over a dictionary as the default behaviour when iterating over a dictionary is to iterate over the keys.

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you follow the steps we provided?

Socials:

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference

In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our contributing guide and our PR template.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

@Sai-Suraj-27 Sai-Suraj-27 changed the title Refactor: Refactored test_assertions.py file. refactor: Refactored test_assertions.py file. Sep 14, 2023
@Mr-Niraj-Kulkarni
Copy link
Contributor

@Sai-Suraj-27, Can you please tag the issue for which these changes were required to be made. Thanks

@Sai-Suraj-27
Copy link
Contributor Author

@Sai-Suraj-27, Can you please tag the issue for which these changes were required to be made. Thanks

Sir, I made these on my own to make the code better and clean. This is a refactoring PR. It's not related to any issue.

@a0m0rajab a0m0rajab modified the milestone: #10388 Sep 14, 2023
Copy link
Contributor

@vedpatwardhan vedpatwardhan left a comment

Choose a reason for hiding this comment

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

Hey @Sai-Suraj-27, just requested a minor change, rest looks good to merge, thanks 😄(thanks for requesting the review @Mr-Niraj-Kulkarni)

sys.stdout = orig_stdout
f.close()

with open(filename, "w") as f:
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add a new line before and after this block similar to how it's done with the next blocks in this function. Same applies to the other changes made

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vedpatwardhan sir, I made the suggested changes, Please look into it now, Thank you.

Copy link
Contributor

@vedpatwardhan vedpatwardhan left a comment

Choose a reason for hiding this comment

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

lgtm! Feel free to merge the PR @Mr-Niraj-Kulkarni, thanks @Sai-Suraj-27 😄

@Daniel4078 Daniel4078 merged commit 3333dbc into ivy-llc:main Sep 27, 2023
112 of 137 checks passed
iababio pushed a commit to iababio/ivy that referenced this pull request Sep 27, 2023
druvdub pushed a commit to druvdub/ivy that referenced this pull request Oct 14, 2023
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.

5 participants