MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_exception_safety

Function test_exception_safety

tests/envcontext_test.py:87–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85
86
87def test_exception_safety():
88 class MyError(RuntimeError):
89 pass
90
91 env = {'hello': 'world'}
92 with pytest.raises(MyError):
93 with envcontext((('foo', 'bar'),), _env=env):
94 raise MyError()
95 assert env == {'hello': 'world'}
96
97
98def test_integration_os_environ():

Callers

nothing calls this directly

Calls 2

envcontextFunction · 0.90
MyErrorClass · 0.85

Tested by

no test coverage detected