From 77c7ab44d33efc9a8cf12684818741cc56852f10 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Wed, 4 Aug 2021 21:23:18 -0700 Subject: [PATCH] Replace deprecated yield_fixture with equivalent to silence warning (#1220) --- conftest.py | 4 ++-- experiment/build/test_builder.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conftest.py b/conftest.py index 397088364..5a91fcfec 100644 --- a/conftest.py +++ b/conftest.py @@ -37,7 +37,7 @@ # Give this a short name since it is a fixture. -@pytest.yield_fixture +@pytest.fixture def db(): # pylint: disable=invalid-name """Connect to the SQLite database and create all the expected tables.""" db_utils.initialize() @@ -61,7 +61,7 @@ def set_sqlite_pragma(connection, _): cursor.close() -@pytest.yield_fixture +@pytest.fixture def environ(): """Patch environment.""" # TODO(metzman): Make sure this is used by all tests that modify the diff --git a/experiment/build/test_builder.py b/experiment/build/test_builder.py index 519da60b0..3cffa1b26 100644 --- a/experiment/build/test_builder.py +++ b/experiment/build/test_builder.py @@ -82,7 +82,7 @@ def test_build_all_measurers(_, mocked_build_measurer, assert not result -@pytest.yield_fixture +@pytest.fixture def builder_integration(experiment): """Fixture for builder.py integration tests that uses an experiment fixture and makes the number of build retries saner by default."""