================================================ test session starts ================================================ platform linux -- Python 3.10.0, pytest-7.1.1, pluggy-1.0.0 collected 14 items test_square_mod.py .............. [100%] ================================================ 14 passed in 0.02s =================================================
================================================ test session starts ================================================ platform linux -- Python 3.10.0, pytest-7.1.1, pluggy-1.0.0 collected 15 items test_square_mod.py ..............F [100%] ===================================================== FAILURES ====================================================== ___________________________________________________ test_negative ___________________________________________________ def test_negative(): > assert not square_mod.is_perfect_square(-4) test_square_mod.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = -4 def is_perfect_square(n: int) -> bool: """Determine if any int i exists such that i × i = n.""" > s = math.sqrt(n) E ValueError: math domain error square_mod.py:5: ValueError ============================================== short test summary info ============================================== FAILED test_square_mod.py::test_negative - ValueError: math domain error =========================================== 1 failed, 14 passed in 0.08s ============================================
================================================ test session starts ================================================ platform linux -- Python 3.10.2, pytest-7.1.1, pluggy-1.0.0 plugins: subtests-0.7.0, runtime-xfail-1.0.3, cov-3.0.0, hypothesis-6.39.4 collected 17 items test_square_mod.py ..............xxx [100%] =========================================== 14 passed, 3 xfailed in 0.03s ===========================================
================================================ test session starts ================================================ platform linux -- Python 3.10.0, pytest-7.1.1, pluggy-1.0.0 collected 15 items test_square_mod.py ..............X [100%] =========================================== 14 passed, 1 xpassed in 0.02s ===========================================
================================================ test session starts ================================================ platform linux -- Python 3.10.0, pytest-7.1.1, pluggy-1.0.0 collected 17 items test_square_mod.py ..............FFF [100%] ===================================================== FAILURES ====================================================== _________________________________________________ test_negative[-1] _________________________________________________ [XPASS(strict)] Bug #11493: Negative values not supported _________________________________________________ test_negative[-3] _________________________________________________ [XPASS(strict)] Bug #11493: Negative values not supported _________________________________________________ test_negative[-4] _________________________________________________ [XPASS(strict)] Bug #11493: Negative values not supported ============================================== short test summary info ============================================== FAILED test_square_mod.py::test_negative[-1] FAILED test_square_mod.py::test_negative[-3] FAILED test_square_mod.py::test_negative[-4] =========================================== 3 failed, 14 passed in 0.03s ============================================
================================================ test session starts ================================================ platform linux -- Python 3.10.0, pytest-7.1.1, pluggy-1.0.0 collected 17 items test_square_mod.py ..............FFF [100%] ===================================================== FAILURES ====================================================== _________________________________________________ test_negative[-1] _________________________________________________ test_square_mod.py:21: in test_negative assert not square_mod.is_perfect_square(m) E NameError: name 'm' is not defined _________________________________________________ test_negative[-3] _________________________________________________ test_square_mod.py:21: in test_negative assert not square_mod.is_perfect_square(m) E NameError: name 'm' is not defined _________________________________________________ test_negative[-4] _________________________________________________ test_square_mod.py:21: in test_negative assert not square_mod.is_perfect_square(m) E NameError: name 'm' is not defined ============================================== short test summary info ============================================== FAILED test_square_mod.py::test_negative[-1] - NameError: name 'm' is not defined FAILED test_square_mod.py::test_negative[-3] - NameError: name 'm' is not defined FAILED test_square_mod.py::test_negative[-4] - NameError: name 'm' is not defined =========================================== 3 failed, 14 passed in 0.09s ============================================
================================================ test session starts ================================================= platform linux -- Python 3.10.2, pytest-7.1.1, pluggy-1.0.0 collected 4 items test_euler_numbers.py .xx. [100%] ============================================ 2 passed, 2 xfailed in 0.03s ============================================
================================================ test session starts ================================================= platform linux -- Python 3.10.2, pytest-7.1.1, pluggy-1.0.0 plugins: hypothesis-6.39.4 collected 1 item test_hypothesis.py x [100%] ================================================= 1 xfailed in 0.22s =================================================
$ python -m unittest -v test_pass (test_unittest.MyTest) ... ok test_xfail (test_unittest.MyTest) ... expected failure test_xpass (test_unittest.MyTest) ... unexpected success ---------------------------------------------------------------------- Ran 3 tests in 0.001s FAILED (expected failures=1, unexpected successes=1)
$ pytest test_unittest.py ================================================ test session starts ================================================= platform linux -- Python 3.10.2, pytest-7.1.1, pluggy-1.0.0 collected 3 items test_unittest.py .xF [100%] ====================================================== FAILURES ====================================================== _________________________________________________ MyTest.test_xpass __________________________________________________ Unexpected success ============================================== short test summary info =============================================== FAILED test_unittest.py::MyTest::test_xpass ======================================= 1 failed, 1 passed, 1 xfailed in 0.04s =======================================