mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
fix: test failures (#6250)
1. Incorrect function was being imported from the module 2. Testing for exception was not done correctly
This commit is contained in:
@ -62,10 +62,8 @@ class Test(unittest.TestCase):
|
||||
self.assertTrue(is_prime(29))
|
||||
|
||||
def test_not_primes(self):
|
||||
self.assertFalse(
|
||||
is_prime(-19),
|
||||
"Negative numbers are excluded by definition of prime numbers.",
|
||||
)
|
||||
with self.assertRaises(AssertionError):
|
||||
is_prime(-19)
|
||||
self.assertFalse(
|
||||
is_prime(0),
|
||||
"Zero doesn't have any positive factors, primes must have exactly two.",
|
||||
|
Reference in New Issue
Block a user