diff options
author | Tim Graham <timograham@gmail.com> | 2017-11-21 12:50:03 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-11-21 12:50:03 -0500 |
commit | 4670752fa522d3e33db6b58a34033a3b89b9ee82 (patch) | |
tree | 5fdbe1cacdb5891ad660a4e46b0bd8c452028e20 | |
parent | 07583029ff64e5c6e894bf3ec5b7c602dfc67b03 (diff) | |
download | python-memcached-4670752fa522d3e33db6b58a34033a3b89b9ee82.tar.gz |
Add test isolation by clearing memcache between each test
-rw-r--r-- | tests/test_memcache.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_memcache.py b/tests/test_memcache.py index 85b241c..b5f8884 100644 --- a/tests/test_memcache.py +++ b/tests/test_memcache.py @@ -31,6 +31,7 @@ class TestMemcache(unittest.TestCase): self.mc = Client(servers, debug=1) def tearDown(self): + self.mc.flush_all() self.mc.disconnect_all() def check_setget(self, key, val, noreply=False): @@ -211,8 +212,9 @@ class TestMemcache(unittest.TestCase): "'NOT_FOUND'\n" ) + @mock.patch.object(_Host, 'send_cmd') # Don't send any commands. @mock.patch.object(_Host, 'readline') - def test_touch_unexpected_reply(self, mock_readline): + def test_touch_unexpected_reply(self, mock_readline, mock_send_cmd): """touch() logs an error upon receiving an unexpected reply.""" mock_readline.return_value = 'SET' # the unexpected reply with captured_stderr() as output: |