def test_term_creation(): """Test the Term constructor. """ v = Variable('foo') t = Term(v) assert t.variable() is v assert t.coefficient() == 1 t = Term(v, 100) assert t.variable() is v assert t.coefficient() == 100 assert str(t) == '100 * foo'
def test_term_creation(): """Test the Term constructor. """ v = Variable('foo') t = Term(v) assert t.variable() is v assert t.coefficient() == 1 t = Term(v, 100) assert t.variable() is v assert t.coefficient() == 100 assert str(t) == '100 * foo'
def test_term_creation(): """Test the Term constructor. """ v = Variable('foo') t = Term(v) assert t.variable() is v assert t.coefficient() == 1 t = Term(v, 100) assert t.variable() is v assert t.coefficient() == 100 assert str(t) == '100 * foo' with pytest.raises(TypeError) as excinfo: Term('') assert 'Variable' in excinfo.exconly() # ensure we test garbage collection del t gc.collect()
def test_term_creation(): """Test the Term constructor. """ v = Variable('foo') t = Term(v) assert t.variable() is v assert t.coefficient() == 1 t = Term(v, 100) assert t.variable() is v assert t.coefficient() == 100 assert str(t) == '100 * foo' with pytest.raises(TypeError) as excinfo: Term('') assert 'Variable' in excinfo.exconly() # ensure we test garbage collection del t gc.collect()