Deprecate tobiko.required_setup_fixture

Change-Id: I96b96346080a4706a6229958f1f432c43ab44d96
This commit is contained in:
Federico Ressi 2021-08-19 09:17:17 +02:00
parent 4233ae5ddf
commit 8c73c8feb5
5 changed files with 40 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# from requirements.txt
decorator===4.4.2
deprecation==2.1.0
docker==4.4.1
dpkt >= 1.8.8
fixtures==3.0.0

View File

@ -1,6 +1,7 @@
# Tobiko framework requirements
decorator>=4.4.2 # BSD
deprecation>=2.1.0 # Apache-2.0
docker>=4.4.1 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
Jinja2>=2.11.2 # BSD

View File

@ -19,6 +19,7 @@ import sys
from tobiko.common import _asserts
from tobiko.common import _cached
from tobiko.common import _config
from tobiko.common import _deprecation
from tobiko.common import _detail
from tobiko.common import _exception
from tobiko.common import _fixture
@ -44,14 +45,16 @@ for path_dir in list(sys.path):
sys.path.remove(path_dir)
cached = _cached.cached
CachedProperty = _cached.CachedProperty
deprecated = _deprecation.deprecated
details_content = _detail.details_content
FailureException = _asserts.FailureException
fail = _asserts.fail
cached = _cached.cached
CachedProperty = _cached.CachedProperty
tobiko_config = _config.tobiko_config
tobiko_config_dir = _config.tobiko_config_dir
tobiko_config_path = _config.tobiko_config_path

View File

@ -0,0 +1,27 @@
# Copyright 2021 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import deprecation
from tobiko import version
def deprecated(deprecated_in: str = None,
removed_in: str = None,
details=""):
return deprecation.deprecated(deprecated_in=deprecated_in,
removed_in=removed_in,
current_version=version.version,
details=details)

View File

@ -26,6 +26,7 @@ import testtools
import tobiko
from tobiko.common import _detail
from tobiko.common import _deprecation
from tobiko.common import _exception
@ -294,6 +295,10 @@ def required_fixture(obj, **params):
return RequiredFixtureProperty(obj, **params)
@_deprecation.deprecated(
deprecated_in='0.4.7',
removed_in='0.4.8',
details='use tobiko.required_fixture function instead')
def required_setup_fixture(obj, **params):
'''Creates a property that sets up fixture identified by given :param obj: