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

Add warning to docs about new_instances method #127

Merged
merged 1 commit into from Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,10 @@ Types of changes:
- Remove documentation and test files from wheels build.
- Re-organize unit tests.

### Documentation

- Add a warning about the usage of `.new_instances()` method in the documentation.

## Release 0.11.2

### Fixed
Expand Down
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