File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -619,6 +619,13 @@ class SomeWallet:
619
619
pytest does not.
620
620
Our tests are fully dependent on pytest so there's no use in retaining ` unittest ` compatibility for this single point.
621
621
Making a few tests ` unittest ` compatible is not useful compared with the cost of inconsistency.
622
+ - Avoid monkey-patching (assigning to a method on a class object or instance)
623
+ as much as possible, and if necessary, opt for it in an explicit and scoped
624
+ manner using the ` monkeypatch ` fixture with a context manager, instead of
625
+ silencing mypy using ` # type: ignore[assignment] ` .
626
+ While in both cases we're signaling to the reader that something smelly/shady
627
+ is going on, and type safety is lost, the monkeypatch approach with a context
628
+ manager allows us to make the scope of the change controlled consistently.
622
629
623
630
## CLI
624
631
You can’t perform that action at this time.
0 commit comments