def test_numbers(): try: response = is_prime(1) assert response == False except Exception as err: print(err) try: response = is_prime(2) assert response == True except Exception as err: print(err) try: response = is_prime(3.14) except Exception as err: print(err)
def test_raises(self): with self.assertRaises(ValueError): is_prime(0) is_prime(3.14) is_prime('Hello')
def test_numbers(self): self.assertEqual(is_prime(2), True) self.assertEqual(is_prime(8), False) self.assertEqual(is_prime(1), False) self.assertEqual(is_prime(83), True) self.assertEqual(is_prime(self.fixture), False)
def test_raises(self): with self.assertRaises(ValueError): is_prime(-1)
def test_numbers(self): self.assertEqual(is_prime(100), False)
def test_is_prime(): response = is_prime(1) assert response == False
def test_numbers(): response = is_prime(1) assert response == False response = is_prime(2) assert response == True