Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
GenericBackend._test_solve: Remove again for now; too many failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed May 24, 2016
1 parent 6604442 commit e6ba997
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/sage/numerical/backends/generic_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -634,35 +634,6 @@ cdef class GenericBackend:
"""
raise NotImplementedError()

## Any test methods involving calls to 'solve' are set up as class methods,
## which make a fresh instance of the backend.
@classmethod
def _test_solve(cls, tester=None, **options):
"""
Trivial test for the solve method.
TEST::
sage: from sage.numerical.backends.generic_backend import GenericBackend
sage: p = GenericBackend()
sage: p._test_solve()
Traceback (most recent call last):
...
NotImplementedError
"""
p = cls() # fresh instance of the backend
if tester is None:
tester = p._tester(**options)
# From doctest of GenericBackend.solve:
tester.assertIsNone(p.add_linear_constraints(5, 0, None))
tester.assertIsNone(p.add_col(range(5), range(5)))
tester.assertEqual(p.solve(), 0)
tester.assertIsNone(p.objective_coefficient(0,1))
from sage.numerical.mip import MIPSolverException
#with tester.assertRaisesRegexp(MIPSolverException, "unbounded") as cm: ## --- too specific
with tester.assertRaises(MIPSolverException) as cm: # unbounded
p.solve()

cpdef get_objective_value(self):
"""
Return the value of the objective function.
Expand Down

0 comments on commit e6ba997

Please sign in to comment.