Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add acceptance tests #2664

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added acceptance/pytest.ini
Empty file.
82 changes: 82 additions & 0 deletions acceptance/test_class.py
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
18 changes: 18 additions & 0 deletions acceptance/test_func.py
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
38 changes: 38 additions & 0 deletions acceptance/test_module_setup_teardown.py
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
4 changes: 4 additions & 0 deletions acceptance/test_random.py
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
22 changes: 22 additions & 0 deletions acceptance/test_skip.py
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
57 changes: 57 additions & 0 deletions acceptance/test_std.py
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")