-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
76c55b3
commit cfb369c
Showing
7 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,82 @@ | ||
class TestClassPassing(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_passing(self): | ||
assert True | ||
|
||
|
||
class TestClassFailing(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_failing(self): | ||
assert False | ||
|
||
|
||
class TestClassError(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_error(self): | ||
1/0 | ||
|
||
|
||
class TestClassFailingAndErrorTeardown(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
1/0 | ||
|
||
def test_error(self): | ||
assert False | ||
|
||
|
||
class TestClassErrorSetup(object): | ||
|
||
def setup_method(self, method): | ||
1/0 | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_passing(self): | ||
assert True | ||
|
||
|
||
class TestClassErrorSetupAndTeardown(object): | ||
|
||
def setup_method(self, method): | ||
1/0 | ||
|
||
def teardown_method(self, method): | ||
1/0 | ||
|
||
def test_passing(self): | ||
assert True | ||
|
||
|
||
class TestClassErrorTeardown(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
1/0 | ||
|
||
def test_passing(self): | ||
assert True |
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,18 @@ | ||
import pytest | ||
|
||
|
||
def test_success(): | ||
assert True | ||
|
||
|
||
def test_fails(): | ||
assert False | ||
|
||
|
||
@pytest.mark.parametrize("number", list(range(3))) | ||
def test_fixtures(number): | ||
assert number % 2 == 0 | ||
|
||
|
||
def test_error(): | ||
1/0 |
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,38 @@ | ||
def setup_module(module): | ||
pass | ||
|
||
|
||
def teardown_module(module): | ||
print("TD MO") | ||
|
||
|
||
def test_passing(): | ||
assert True | ||
|
||
|
||
def test_failing(): | ||
assert False | ||
|
||
|
||
class TestClassPassing(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_passing(self): | ||
assert True | ||
|
||
|
||
class TestClassFailing(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
print("TD M") | ||
|
||
def test_failing(self): | ||
assert False |
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,4 @@ | ||
import random | ||
|
||
def test_random(): | ||
assert random.randint(1, 2) == 1 |
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,22 @@ | ||
import pytest | ||
|
||
@pytest.mark.skip(reason="Skip") | ||
def test_skip_function(): | ||
pass | ||
|
||
|
||
class TestSkipCall(object): | ||
|
||
@pytest.mark.skip(reason="Skip") | ||
def test_skip_method(self): | ||
pass | ||
|
||
|
||
@pytest.mark.skip(reason="Skip") | ||
class TestSkipClass(object): | ||
|
||
def test_skipped_1(self): | ||
pass | ||
|
||
def test_skipped_2(self): | ||
pass |
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,57 @@ | ||
import sys | ||
|
||
|
||
def test_stdout(): | ||
print("STDOUT") | ||
|
||
|
||
def test_stderr(): | ||
sys.stderr.write("STDERR\n") | ||
|
||
|
||
class TestClassStdout(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_stdout(self): | ||
print("STDOUT") | ||
|
||
|
||
class TestClassStdoutSetup(object): | ||
|
||
def setup_method(self, method): | ||
print("SETUP") | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_stdout(self): | ||
pass | ||
|
||
|
||
class TestClassStdoutAllPhases(object): | ||
|
||
def setup_method(self, method): | ||
print("SETUP") | ||
|
||
def teardown_method(self, method): | ||
print("TEARDOWN") | ||
|
||
def test_stdout(self): | ||
print("TEST") | ||
|
||
|
||
class TestClassFailing(object): | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_stderr(self): | ||
sys.stderr.write("STDERR\n") |