MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_transaction_error_without_lock

Function test_transaction_error_without_lock

test/test_transaction.py:125–132  ·  view source on GitHub ↗

Test that setting target without lock raises error.

(testrepo: Repository)

Source from the content-addressed store, hash-verified

123
124
125def test_transaction_error_without_lock(testrepo: Repository) -> None:
126 """Test that setting target without lock raises error."""
127 new_target = Oid(hex='5ebeeebb320790caf276b9fc8b24546d63316533')
128
129 with pytest.raises(KeyError, match='not locked'):
130 with testrepo.transaction() as txn:
131 # Try to set target without locking first
132 txn.set_target('refs/heads/master', new_target, message='Should fail')
133
134
135def test_transaction_isolated_across_threads(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

transactionMethod · 0.80
set_targetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…