Remove deprecated async property

This no longer works in Python 3.7 or later because async is now
a keyword. Because now the minimum python version supported is 3.8,
the compatibility code is not useful.

See df6bf3401266f42271627c1e408f87c71a06cef7 for further details.

Change-Id: Ib04858dda47fcbcafe027f222030506d7477e43b
This commit is contained in:
Takashi Kajinami 2024-09-03 16:29:14 +09:00
parent a59dba4479
commit a6d89f55e7
2 changed files with 0 additions and 34 deletions

View File

@ -17,7 +17,6 @@ import operator
import threading
import warnings
import debtcollector.moves
import debtcollector.removals
import debtcollector.renames
from oslo_config import cfg
@ -1055,18 +1054,6 @@ class _TransactionContextManager(object):
transaction_contexts_by_thread.current = restore
@property
@debtcollector.moves.moved_property("async_")
def async_compat(self):
return self.async_
setattr(
_TransactionContextManager,
"async", async_compat
)
def _context_descriptor(attr=None):
getter = operator.attrgetter(attr)

View File

@ -15,7 +15,6 @@ import contextlib
import copy
import fixtures
import pickle
import sys
from unittest import mock
import warnings
@ -785,26 +784,6 @@ class MockFacadeTest(test_base.BaseTestCase):
with self._assert_writer_session(makers) as session:
session.execute("test2")
def test_deprecated_async_reader_name(self):
if sys.version_info >= (3, 7):
self.skipTest("Test only runs on Python < 3.7")
context = oslo_context.RequestContext()
old = getattr(enginefacade.reader, "async")
@old
def go1(context):
context.session.execute("test1")
go1(context)
with self._assert_engines() as engines:
with self._assert_makers(engines) as makers:
with self._assert_async_reader_session(
makers, assert_calls=False) as session:
session.execute("test1")
def test_async_reader_then_reader_ok(self):
context = oslo_context.RequestContext()