Skip to content

Commit

Permalink
Release v0.1.0
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
nfx committed Apr 16, 2024
1 parent 595ad15 commit 53f9908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Version changelog

## 0.1.0

* Added checks for mocking best practices ([#27](https://github.com/databrickslabs/pylint-plugin/issues/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.


## 0.0.1

Initial public release
Expand Down
2 changes: 1 addition & 1 deletion src/databricks/labs/pylint/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.1.0"

0 comments on commit 53f9908

Please sign in to comment.