[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Stop tracking reverted mocks



commit 5c01e29839a084018185ce005c9ec90788e13fce
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Feb 4 18:05:31 2012 -0800

    Stop tracking reverted mocks
    
    When we reverted function mocking we didn't clear our registration of it. This
    caused the revert_mocking() function to attempt to revert things that weren't
    still mocked. This didn't cause any problems since doing this was a no-op, but
    still good to fix.
---
 test/mocking.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/test/mocking.py b/test/mocking.py
index 30ba490..1e98cef 100644
--- a/test/mocking.py
+++ b/test/mocking.py
@@ -96,6 +96,7 @@ def revert_mocking():
   for mock_id in mock_ids:
     module, function, impl = MOCK_STATE[mock_id]
     module.__dict__[function] = impl
+    del MOCK_STATE[mock_id]
   
   MOCK_STATE.clear()
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits