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 Deprecator.skip_warning? ability to silence deprecators on tests #2956

Merged
merged 15 commits into from
Jul 9, 2024

Conversation

keshavbiswa
Copy link
Contributor

Motivation / Background

Fixes: #2948

This Pull Request has been created because We want the ability to silence output warnings for Deprecated Generators in tests.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • Tests and Rubocop are passing before submitting your proposed changes.

If you're proposing a new generator or locale:

  • Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
  • You've reviewed and followed the Contributing guidelines.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

This LGTM, thank you!

@thdaraujo could you give a review when you can? Thanks!

lib/faker/locations/australia.rb Outdated Show resolved Hide resolved
lib/helpers/deprecator.rb Show resolved Hide resolved
Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

This is just for our own testing purposes, right?

If yes, then it looks good to me - but left a suggestion so we don't use a class variable.

And Faker::Theater still displays a warning, not sure why.

lib/helpers/deprecator.rb Outdated Show resolved Hide resolved
lib/helpers/deprecator.rb Outdated Show resolved Hide resolved
@keshavbiswa
Copy link
Contributor Author

@thdaraujo Thanks, I'll take a look at your suggestion and also figure out why you're seeing the deprecation message.

@keshavbiswa
Copy link
Contributor Author

@thdaraujo @stefannibrasil I have fixed the issue and have updated your requested changes.

@keshavbiswa
Copy link
Contributor Author

@stefannibrasil Reordered it, I misunderstood earlier

This variable is not needed anymore.
lib/helpers/deprecator.rb Outdated Show resolved Hide resolved
@thdaraujo thdaraujo changed the title Added skip_warning ability to deprecators for tests Added skip_warning ability to silence deprecators on tests Jul 9, 2024
@thdaraujo thdaraujo changed the title Added skip_warning ability to silence deprecators on tests Add skip_warning ability to silence deprecators on tests Jul 9, 2024
@thdaraujo thdaraujo changed the title Add skip_warning ability to silence deprecators on tests Add Deprecator.skip_warning? ability to silence deprecators on tests Jul 9, 2024
Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

perfect, thanks for working on this! @keshavbiswa

@thdaraujo thdaraujo merged commit 2b5df17 into faker-ruby:main Jul 9, 2024
8 checks passed
@keshavbiswa keshavbiswa deleted the add-silence-to-dep-warnings branch July 9, 2024 15:28
@keshavbiswa keshavbiswa restored the add-silence-to-dep-warnings branch July 9, 2024 15:28
@keshavbiswa keshavbiswa deleted the add-silence-to-dep-warnings branch July 9, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to silence deprecation warnings when running the tests
3 participants