Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUpClass(cls):
so.reset()
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
cls.defstdout = sys.stdout
except SWATError:
raise unittest.SkipTest('Cannot establish CAS connection. ' \
+ 'Check your environment variables ' \
+ '(CASHOST, CASPORT, AUTHINFO)')
except TypeError:
raise unittest.SkipTest('Environment variable may not be defined')
def setUpClass(cls):
so.reset()
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
m.set_objective(x + 1.1 * y, sense=minimize, name='obj2')
m.solve(mps=True, primalin=True)
self.assertEqual(
session.CASTable('PRIMALINTABLE').to_frame().to_string(), cleandoc(
'''
_VAR_ _VALUE_
0 x 6.0
1 y 2.0
'''
))
# Drop option
m.solve(mps=True, primalin=True, drop=True)
def deleted_table():
s = session.CASTable('PRIMALINTABLE').to_frame()
self.assertRaises(SWATError, deleted_table)
def setUpClass(cls):
so.reset()
cls.conn = None
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
so.reset()
cls.conn = None
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
so.reset()
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
so.reset()
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
so.reset()
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available', RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available', RuntimeWarning)
def setUpClass(cls):
cls.conn = None
from swat import CAS, SWATError
try:
cls.conn = create_cas_connection()
except SWATError:
warnings.warn('CAS connection is not available',
RuntimeWarning)
except TypeError:
warnings.warn('CAS variables are not available',
RuntimeWarning)