tests/system/action/lock.py
def monkeypatch_datastore_adapter_write() -> Iterator[None]:
    """
    Use a patched DatastoreAdapter.write in this context,
    which wraps the write with an optional lock from pytest_thread_local.testlock
    """
    DatastoreAdapter.write_original = DatastoreAdapter.write  # type: ignore
    DatastoreAdapter.write = write  # type: ignore
    try:
        yield
    finally:
        DatastoreAdapter.write = DatastoreAdapter.write_original  # type: ignore
        delattr(DatastoreAdapter, "write_original")

    Use a patched DatastoreAdapter.write in this context,
    which wraps the write with an optional lock from pytest_thread_local.testlock
    
Use a patched DatastoreAdapter.write in this context,
which wraps the write with an optional lock from pytest_thread_local.testlock
Use a patched DatastoreAdapter . write in this context which wraps the write with an optional lock from pytest_thread_local . testlock
def monkeypatch_datastore_adapter_write() -> Iterator[None]:
    DatastoreAdapter.write_original = DatastoreAdapter.write  
    DatastoreAdapter.write = write  
    try:
        yield
    finally:
        DatastoreAdapter.write = DatastoreAdapter.write_original  
        delattr(DatastoreAdapter, "write_original")
def monkeypatch_datastore_adapter_write ( ) -> Iterator [ None ] : DatastoreAdapter . write_original = DatastoreAdapter . write DatastoreAdapter . write = write try : yield finally : DatastoreAdapter . write = DatastoreAdapter . write_original delattr ( DatastoreAdapter , "write_original" )
Use a patched DatastoreAdapter.write in this context,
which wraps the write with an optional lock from pytest_thread_local.testlock
Use a patched DatastoreAdapter . write in this context which wraps the write with an optional lock from pytest_thread_local . testlock
"""
    Use a patched DatastoreAdapter.write in this context,
    which wraps the write with an optional lock from pytest_thread_local.testlock
    """ # type: ignore # type: ignore # type: ignore