MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / test_context_manager

Method test_context_manager

tests/test_z3_compat.py:448–456  ·  view source on GitHub ↗
(self, kernel)

Source from the content-addressed store, hash-verified

446 assert s.check() == unknown
447
448 def test_context_manager(self, kernel):
449 x = Int("x")
450 s = Solver()
451 s.add(x > 0)
452 with s:
453 s.add(x < 0)
454 assert s.check() == unsat
455 # After context exit, back to just x > 0
456 assert len(s.assertions()) == 1
457
458 def test_reset(self, kernel):
459 s = Solver()

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
checkMethod · 0.95
assertionsMethod · 0.95
IntFunction · 0.90
SolverClass · 0.90

Tested by

no test coverage detected