擅长:python、mysql、java
<p>看看@Martinj Pieters comment,但是也可以使用pytest<a href="https://docs.pytest.org/en/documentation-restructure/how-to/monkeypatch.html" rel="nofollow noreferrer">https://docs.pytest.org/en/documentation-restructure/how-to/monkeypatch.html</a>中支持的monkey patching<a href="https://en.wikipedia.org/wiki/Monkey_patch" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Monkey_patch</a>来重写<code>__init__</code>方法。你知道吗</p>