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()
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()