Skip to content

Commit

Permalink
Adding an example
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadelmalah committed May 7, 2024
1 parent 2421032 commit f129bd4
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions testing/test_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@
from sum import sum


# 2 failed
def test_fail():
assert sum(1, 2) == 4


def test_fail2():
x = 5 / 0
assert sum(1, 2) == 3


# 1 passed
def test_pass():
assert sum(1, 2) == 3


def test_fail():
assert sum(1, 2) == 4
# 1 skipped
@pytest.mark.skip(reason="Do not run this test")
def test_sum_skip():
assert sum(1, 2) == 3


# Xfailed
# 2 xfailed
@pytest.mark.xfail()
def test_sum_negative():
assert sum(1, 2) == 4
Expand All @@ -21,13 +34,7 @@ def test_sum_negative_raise():
raise Exception("This test is expected to fail")


# XPassed
# 1 xpassed
@pytest.mark.xfail()
def test_sum_positive():
assert sum(1, 2) == 3


# Skipped
@pytest.mark.skip(reason="Do not run this test")
def test_sum_skip():
assert sum(1, 2) == 3

0 comments on commit f129bd4

Please sign in to comment.