diff --git a/pytest-fixture-config/tests/unit/test_fixture_config.py b/pytest-fixture-config/tests/unit/test_fixture_config.py index bdbe9ef..4c17255 100644 --- a/pytest-fixture-config/tests/unit/test_fixture_config.py +++ b/pytest-fixture-config/tests/unit/test_fixture_config.py @@ -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') @@ -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' diff --git a/pytest-git/pytest_git.py b/pytest-git/pytest_git.py index 078f5fc..8ff3b28 100644 --- a/pytest-git/pytest_git.py +++ b/pytest-git/pytest_git.py @@ -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. diff --git a/pytest-listener/pytest_listener.py b/pytest-listener/pytest_listener.py index e910820..90acccc 100644 --- a/pytest-listener/pytest_listener.py +++ b/pytest-listener/pytest_listener.py @@ -24,7 +24,7 @@ ) -@pytest.yield_fixture(scope='module') +@pytest.fixture(scope='module') def listener(request): """ Simple module-scoped network listener. diff --git a/pytest-qt-app/pytest_qt_app.py b/pytest-qt-app/pytest_qt_app.py index 460f641..dfa7414 100644 --- a/pytest-qt-app/pytest_qt_app.py +++ b/pytest-qt-app/pytest_qt_app.py @@ -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 """ diff --git a/pytest-server-fixtures/pytest_server_fixtures/http.py b/pytest-server-fixtures/pytest_server_fixtures/http.py index 872d78d..b23dd36 100644 --- a/pytest-server-fixtures/pytest_server_fixtures/http.py +++ b/pytest-server-fixtures/pytest_server_fixtures/http.py @@ -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. """ diff --git a/pytest-server-fixtures/pytest_server_fixtures/httpd.py b/pytest-server-fixtures/pytest_server_fixtures/httpd.py index 5a80395..e3a347d 100644 --- a/pytest-server-fixtures/pytest_server_fixtures/httpd.py +++ b/pytest-server-fixtures/pytest_server_fixtures/httpd.py @@ -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. diff --git a/pytest-server-fixtures/pytest_server_fixtures/jenkins.py b/pytest-server-fixtures/pytest_server_fixtures/jenkins.py index 90034d7..f29957b 100644 --- a/pytest-server-fixtures/pytest_server_fixtures/jenkins.py +++ b/pytest-server-fixtures/pytest_server_fixtures/jenkins.py @@ -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 @@ -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 diff --git a/pytest-server-fixtures/pytest_server_fixtures/mongo.py b/pytest-server-fixtures/pytest_server_fixtures/mongo.py index dd6d912..5333542 100644 --- a/pytest-server-fixtures/pytest_server_fixtures/mongo.py +++ b/pytest-server-fixtures/pytest_server_fixtures/mongo.py @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/pytest-server-fixtures/pytest_server_fixtures/xvfb.py b/pytest-server-fixtures/pytest_server_fixtures/xvfb.py index 01d858b..cf8f658 100644 --- a/pytest-server-fixtures/pytest_server_fixtures/xvfb.py +++ b/pytest-server-fixtures/pytest_server_fixtures/xvfb.py @@ -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. @@ -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. diff --git a/pytest-shutil/pytest_shutil/workspace.py b/pytest-shutil/pytest_shutil/workspace.py index 3ca5e2c..d3b9eea 100644 --- a/pytest-shutil/pytest_shutil/workspace.py +++ b/pytest-shutil/pytest_shutil/workspace.py @@ -14,7 +14,7 @@ log = logging.getLogger(__name__) -@pytest.yield_fixture() +@pytest.fixture() def workspace(): """ Function-scoped temporary workspace that cleans up on exit. diff --git a/pytest-svn/pytest_svn.py b/pytest-svn/pytest_svn.py index a147414..3b1f2d0 100644 --- a/pytest-svn/pytest_svn.py +++ b/pytest-svn/pytest_svn.py @@ -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. diff --git a/pytest-webdriver/pytest_webdriver.py b/pytest-webdriver/pytest_webdriver.py index 0400e7e..5ee85d2 100644 --- a/pytest-webdriver/pytest_webdriver.py +++ b/pytest-webdriver/pytest_webdriver.py @@ -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.