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