Skip to content

Replace the deprecated pytest.yield_fixture in test/test_tls.py #284

Description

@jaysonsantos

Found while working on #274.

Evidence

test/test_tls.py:16 uses pytest.yield_fixture:

@pytest.yield_fixture(scope="module", autouse=True)
def memcached_tls():

pytest.yield_fixture is a deprecated alias of @pytest.fixture. The suite
prints one PytestDeprecationWarning for it on every run.

#274 replaced the four uses in test/conftest.py. It did not touch
test/test_tls.py, because that file is outside its stated scope.

Scope

One line. Replace @pytest.yield_fixture with @pytest.fixture.

Consider whether test/test_tls.py should also use the shared
_wait_until_accepting helper that #274 added to test/conftest.py. It holds
its own time.sleep(0.1) and its own p.poll() check today.

Acceptance criteria

  • test/test_tls.py uses @pytest.fixture.
  • pytest -q prints no PytestDeprecationWarning.
  • The TLS tests still pass and still skip cleanly on a memcached without
    TLS support.

Order

Do #274 first. It adds the helper this issue can reuse.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode quality, typing and defects

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions