Skip to content
Open
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
4 changes: 2 additions & 2 deletions pytest-fixture-config/tests/unit/test_fixture_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_requires_config_doesnt_skip(another_fixture):



@pytest.yield_fixture
@pytest.fixture
@yield_requires_config(CONFIG1, ('foo', 'bar'))
def yet_another_fixture():
raise ValueError('Should also not run')
Expand All @@ -59,7 +59,7 @@ def test_yield_requires_config_skips(yet_another_fixture):
raise ValueError('Should also not run')


@pytest.yield_fixture
@pytest.fixture
@yield_requires_config(CONFIG1, ('bar',))
def yet_some_other_fixture():
yield 'yyyy'
Expand Down
2 changes: 1 addition & 1 deletion pytest-git/pytest_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from git import Repo


@pytest.yield_fixture
@pytest.fixture
def git_repo(request):
""" Function-scoped fixture to create a new git repo in a temporary workspace.

Expand Down
2 changes: 1 addition & 1 deletion pytest-listener/pytest_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)


@pytest.yield_fixture(scope='module')
@pytest.fixture(scope='module')
def listener(request):
""" Simple module-scoped network listener.

Expand Down
2 changes: 1 addition & 1 deletion pytest-qt-app/pytest_qt_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class _TestQtApp(object):
TestQtApp = _TestQtApp()


@pytest.yield_fixture(scope="session")
@pytest.fixture(scope="session")
def q_application():
""" Initialise a QT application with a Xvfb server
"""
Expand Down
2 changes: 1 addition & 1 deletion pytest-server-fixtures/pytest_server_fixtures/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
log = logging.getLogger(__name__)


@pytest.yield_fixture
@pytest.fixture
def simple_http_test_server():
""" Function-scoped py.test fixture to serve up a directory via HTTP.
"""
Expand Down
2 changes: 1 addition & 1 deletion pytest-server-fixtures/pytest_server_fixtures/httpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def is_rhel():
""""Check if OS is RHEL/Centos"""
return 'el' in platform.uname()[2]

@pytest.yield_fixture(scope='function')
@pytest.fixture(scope='function')
@yield_requires_config(CONFIG, ['httpd_executable', 'httpd_modules'])
def httpd_server():
""" Function-scoped httpd server in a local thread.
Expand Down
4 changes: 2 additions & 2 deletions pytest-server-fixtures/pytest_server_fixtures/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .http import HTTPTestServer


@pytest.yield_fixture(scope='session')
@pytest.fixture(scope='session')
@yield_requires_config(CONFIG, ['jenkins_war', 'java_executable'])
def jenkins_server():
""" Session-scoped Jenkins server instance
Expand All @@ -29,7 +29,7 @@ def jenkins_server():
yield p


@pytest.yield_fixture(scope='module')
@pytest.fixture(scope='module')
@yield_requires_config(CONFIG, ['jenkins_war', 'java_executable'])
def jenkins_server_module():
""" Module-scoped Jenkins server instance
Expand Down
8 changes: 4 additions & 4 deletions pytest-server-fixtures/pytest_server_fixtures/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _mongo_server():
test_server.teardown()


@pytest.yield_fixture(scope='function')
@pytest.fixture(scope='function')
@yield_requires_config(CONFIG, ['mongo_bin'])
def mongo_server():
""" Function-scoped MongoDB server started in a local thread.
Expand All @@ -40,7 +40,7 @@ def mongo_server():
yield server


@pytest.yield_fixture(scope='session')
@pytest.fixture(scope='session')
@yield_requires_config(CONFIG, ['mongo_bin'])
def mongo_server_sess():
""" Same as mongo_server fixture, scoped as session instead.
Expand All @@ -49,7 +49,7 @@ def mongo_server_sess():
yield server


@pytest.yield_fixture(scope='class')
@pytest.fixture(scope='class')
@yield_requires_config(CONFIG, ['mongo_bin'])
def mongo_server_cls(request):
""" Same as mongo_server fixture, scoped for test classes.
Expand All @@ -59,7 +59,7 @@ def mongo_server_cls(request):
yield server


@pytest.yield_fixture(scope='module')
@pytest.fixture(scope='module')
@yield_requires_config(CONFIG, ['mongo_bin'])
def mongo_server_module():
""" Same as mongo_server fixture, scoped for test modules.
Expand Down
4 changes: 2 additions & 2 deletions pytest-server-fixtures/pytest_server_fixtures/xvfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pytest_server_fixtures import CONFIG


@pytest.yield_fixture(scope='function')
@pytest.fixture(scope='function')
@yield_requires_config(CONFIG, ['xvfb_executable'])
def xvfb_server():
""" Function-scoped Xvfb (X-Windows Virtual Frame Buffer) in a local thread.
Expand All @@ -23,7 +23,7 @@ def xvfb_server():
test_server.close()


@pytest.yield_fixture(scope='session')
@pytest.fixture(scope='session')
@yield_requires_config(CONFIG, ['xvfb_executable'])
def xvfb_server_sess():
""" Session-scoped Xvfb (X-Windows Virtual Frame Buffer) in a local thread.
Expand Down
2 changes: 1 addition & 1 deletion pytest-shutil/pytest_shutil/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
log = logging.getLogger(__name__)


@pytest.yield_fixture()
@pytest.fixture()
def workspace():
""" Function-scoped temporary workspace that cleans up on exit.

Expand Down
2 changes: 1 addition & 1 deletion pytest-svn/pytest_svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pytest_shutil.workspace import Workspace


@pytest.yield_fixture()
@pytest.fixture()
def svn_repo():
""" Function-scoped fixture to create a new svn repo in a temporary workspace.

Expand Down
2 changes: 1 addition & 1 deletion pytest-webdriver/pytest_webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def browser_to_use(webdriver, browser):
return b


@pytest.yield_fixture(scope='function')
@pytest.fixture(scope='function')
def webdriver(request):
""" Connects to a remote selenium webdriver and returns the browser handle.
Scoped on a per-function level so you get one browser window per test.
Expand Down