-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import gc | ||
|
||
import hiredis | ||
|
||
|
||
def test_reader_gc(): | ||
class A: | ||
def __init__(self): | ||
self.reader = hiredis.Reader(replyError=self.reply_error) | ||
|
||
def reply_error(self, error): | ||
return Exception() | ||
|
||
A() | ||
gc.collect() | ||
|
||
assert not any(isinstance(o, A) for o in gc.get_objects()), "Referent was not collected" |