コード例 #1
0
 def test_nesting(self):
     set_thread_readwrite_db()
     assert is_thread_readwrite()
     with readonly_db():
         assert not is_thread_readwrite()
         with readwrite_db():
             assert is_thread_readwrite()
         assert not is_thread_readwrite()
     assert is_thread_readwrite()
コード例 #2
0
 def test_with_readonly_db_when_readwrite(self):
     set_thread_readwrite_db()
     assert is_thread_readwrite()
     with readonly_db():
         assert not is_thread_readwrite()
     assert is_thread_readwrite()