def test_basic(): assert power(2, 3, 1000) == 9
def test_second(): assert power(5, 0, 10) == 1
def test_mod(mod): assert power(2, 4, 10000) == 16 assert power(2, 10, mod.modulus) == 0
def test_exception(): with pytest.raises(Exception): res = power(0, 0, 2)
def test_ten(self): assert power(0, 10, 1000) == 0
def test_hundred(self): assert power(0, 100, 1000) == 0
def test_basic(): assert power(2, 3, 1000) == 8
def test_p2_basic(self): if pytest.config.p2: print 'Testing for %d' % pytest.config.p2 assert power(2, pytest.config.p2, 1000000) == \ (math.pow(2, pytest.config.p2) % 1000000)