diff --git a/acceptance/pytest.ini b/acceptance/pytest.ini new file mode 100644 index 00000000000..e69de29bb2d diff --git a/acceptance/test_class.py b/acceptance/test_class.py new file mode 100644 index 00000000000..0d250893ad5 --- /dev/null +++ b/acceptance/test_class.py @@ -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 diff --git a/acceptance/test_func.py b/acceptance/test_func.py new file mode 100644 index 00000000000..100a789a7c0 --- /dev/null +++ b/acceptance/test_func.py @@ -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 \ No newline at end of file diff --git a/acceptance/test_module_setup_teardown.py b/acceptance/test_module_setup_teardown.py new file mode 100644 index 00000000000..f6569c940d2 --- /dev/null +++ b/acceptance/test_module_setup_teardown.py @@ -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 \ No newline at end of file diff --git a/acceptance/test_random.py b/acceptance/test_random.py new file mode 100644 index 00000000000..935ac9c653f --- /dev/null +++ b/acceptance/test_random.py @@ -0,0 +1,4 @@ +import random + +def test_random(): + assert random.randint(1, 2) == 1 \ No newline at end of file diff --git a/acceptance/test_skip.py b/acceptance/test_skip.py new file mode 100644 index 00000000000..f8d960f0ece --- /dev/null +++ b/acceptance/test_skip.py @@ -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 diff --git a/acceptance/test_std.py b/acceptance/test_std.py new file mode 100644 index 00000000000..aba114f5489 --- /dev/null +++ b/acceptance/test_std.py @@ -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")