コード例 #1
0
def test_sqrt_greater_than_zero():
    import math
    x = 12.3
    assert _sqrt_pow2(x) == math.sqrt(x)
コード例 #2
0
def test_power2():
    x = -1.2
    assert _sqrt_pow2(x) == x**2
コード例 #3
0
 def test_string(self):
     with pytest.raises(TypeError):
         _sqrt_pow2("156")
コード例 #4
0
 def test_non_numeric_object(self):
     with pytest.raises(TypeError):
         _sqrt_pow2([512])
コード例 #5
0
def test_sqrt_zero():
    assert _sqrt_pow2(0) == 0