Skip to content

Commit

Permalink
Add warning to docs about new_instances method
Browse files Browse the repository at this point in the history
  • Loading branch information
ollipa committed Feb 6, 2022
1 parent 31091e7 commit 2b17f80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/advanced/new_instances.md
Expand Up @@ -15,6 +15,13 @@ now been replaced by a function.

Flexmock offers another alternative using the `.new_instances()` method:

!!!warning

Usage of `.new_instances()` method is discouraged due to a bug in CPython
which prevents proper teardown of the mock. Due to this bug, the mock leaks
into other tests and can prevent creating new instances of the class. More
information in [issue #16](https://github.com/flexmock/flexmock/issues/16).

```python
>>> class Group: pass
>>> fake_group = flexmock(name="fake")
Expand Down

0 comments on commit 2b17f80

Please sign in to comment.