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

Release v0.1.0 #28

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Release v0.1.0 #28

merged 1 commit into from
Apr 16, 2024

Conversation

nfx
Copy link
Collaborator

@nfx nfx commented Apr 16, 2024

  • Added checks for mocking best practices (#27). A new mocking checker has been added to the pylint plugin for Databricks to improve the quality of unit tests by enforcing best practices in mocking. This checker introduces two rules: explicit-dependency-required and obscure-mock. The explicit-dependency-required rule encourages injecting dependencies through constructors instead of using mock.patch, promoting code readability, maintainability, and dependency inversion for unit testing. The obscure-mock rule recommends using create_autospec(ConcreteType) over MagicMock to create mock objects that behave like concrete classes, resulting in more robust and maintainable unit tests. These rules can be configured to specify package names containing project code. This addition helps developers create reliable, maintainable, and testable code by adhering to recommended mocking practices.

* Added checks for mocking best practices ([#27](#27)). A new `mocking` checker has been added to the pylint plugin for Databricks to improve the quality of unit tests by enforcing best practices in mocking. This checker introduces two rules: `explicit-dependency-required` and `obscure-mock`. The `explicit-dependency-required` rule encourages injecting dependencies through constructors instead of using `mock.patch`, promoting code readability, maintainability, and dependency inversion for unit testing. The `obscure-mock` rule recommends using `create_autospec(ConcreteType)` over `MagicMock` to create mock objects that behave like concrete classes, resulting in more robust and maintainable unit tests. These rules can be configured to specify package names containing project code. This addition helps developers create reliable, maintainable, and testable code by adhering to recommended mocking practices.
@nfx nfx merged commit d80c3db into main Apr 16, 2024
8 checks passed
@nfx nfx deleted the prepare/0.1.0 branch April 16, 2024 18:02
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.

1 participant