-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f48398
commit 89ba71f
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
from sum import sum | ||
|
||
|
||
def test_pass(): | ||
assert sum(1, 2) == 3 | ||
|
||
|
||
def test_fail(): | ||
assert sum(1, 2) == 4 | ||
|
||
|
||
# Xfailed | ||
@pytest.mark.xfail() | ||
def test_sum_negative(): | ||
assert sum(1, 2) == 4 | ||
|
||
|
||
@pytest.mark.xfail() | ||
def test_sum_negative_raise(): | ||
raise Exception("This test is expected to fail") | ||
|
||
|
||
# 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 |