Remove old python2-related code and add python 3.11 support #715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since we decided to support only py3.7+ (and possibly 3.6) this PR aims to clean the code base from python2 old-style and compatibility constructs, including:
u''
,u""
)# -*- coding: UTF-8 -*-
at the top of a file)object
unicode_literals
,absolute_import
,division
,print_function
(i.e. constructs in formfrom __future__ import "<feature>"
)allure_commons._compat.format_exception_only
function andallure_commons._compat
module altogether (traceback.format_exception_only
is used instead)six
compatability library:six.PY2
was removedsix.with_metaclass
replaced withmetaclass=
in object class declarationssix.text_type
is alwaysstr
in py3six.string_types
is alwaysstr
in py3enum32
dependency ofallure-python-commons
: backport of enums for py3.4allure_commons.logger.AllureFileLogger._report_item
allure_commons.utils.escape_non_unicode_symbols
function (returns an argument itself in python3)allure_commons.getargspec
function (inspect.getfullargspec
is used in py3 instead)Also made some refactorings and small changes:
%-formatting
andstr.format
with string interpolation (f-strings
) where is improves readabilitybuild
workflowbuild
workflowcheckout
to v3 andsetup-python
to v4 in therelease
workflowallure_pytest.helper.AllureTestHelper.decorate_as_link
andallure_pytest.listener.AllureListener.add_link
toallure_pytest.utils.format_allure_link
(following DRY)allure_test/test/acceptance/fixture/yield_fixture_test.py::test_yield_fixture
test to actually check a yield-fixture (not a usual one) - Fixes Allure-pytest: Yield_fixture test is invalid #551allure_robotframework.listener.utils
, makeparse_link
a module-level function (it has no dependencies on local variables)