[packages/python3-behave] - python-behave.spec updated to 1.3.3 for python 3.6+
qboosh
qboosh at pld-linux.org
Thu Mar 12 22:43:16 CET 2026
commit 7735dfa1184b2272d1bbbeede7fa8c2d81820ca4
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Mar 12 22:43:18 2026 +0100
- python-behave.spec updated to 1.3.3 for python 3.6+
behave-backport-for-py38-fixes.patch | 573 ------------------------
behave-drop_2to3.patch | 11 -
behave-invalid-escape-seq.patch | 82 ----
behave-mock.patch | 187 ++++++++
behave-sphinx-extlinks.patch | 13 -
behave-tweak-tests-required-by-pytest-5.0.patch | 111 -----
python-behave-mock.patch | 56 ---
python-behave.spec | 188 --------
python3-behave.spec | 116 +++++
9 files changed, 303 insertions(+), 1034 deletions(-)
---
diff --git a/python-behave.spec b/python-behave.spec
deleted file mode 100644
index e882ea5..0000000
--- a/python-behave.spec
+++ /dev/null
@@ -1,188 +0,0 @@
-#
-# Conditional build:
-%bcond_without doc # Sphinx documentation
-%bcond_without tests # unit tests
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
-
-Summary: Behaviour-driven development, Python style
-Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
-Name: python-behave
-Version: 1.2.6
-Release: 9
-License: BSD
-Group: Libraries/Python
-#Source0Download: https://pypi.org/simple/behave/
-Source0: https://files.pythonhosted.org/packages/source/b/behave/behave-%{version}.tar.gz
-# Source0-md5: 3f05c859a1c45f5ed33e925817ad887d
-Patch0: %{name}-mock.patch
-Patch1: behave-backport-for-py38-fixes.patch
-Patch2: behave-tweak-tests-required-by-pytest-5.0.patch
-Patch3: behave-invalid-escape-seq.patch
-Patch4: behave-sphinx-extlinks.patch
-Patch5: behave-drop_2to3.patch
-URL: https://pypi.org/project/behave/
-%if %{with python2}
-BuildRequires: python-modules >= 1:2.6
-BuildRequires: python-setuptools
-%if %{with tests}
-BuildRequires: python-enum34
-BuildRequires: python-mock >= 2.0
-BuildRequires: python-nose >= 1.3
-BuildRequires: python-parse >= 1.8.2
-BuildRequires: python-parse_type >= 0.4.2
-BuildRequires: python-path >= 10.1
-BuildRequires: python-pyhamcrest >= 1.9
-BuildRequires: python-pytest >= 3.0
-BuildRequires: python-six >= 1.11
-BuildRequires: python-traceback2
-%if "%{py_ver}" < "2.7"
-BuildRequires: python-argparse
-BuildRequires: python-importlib
-BuildRequires: python-ordereddict
-%endif
-%endif
-%endif
-%if %{with python3}
-BuildRequires: python3-modules >= 1:3.4
-BuildRequires: python3-setuptools
-%if %{with tests}
-BuildRequires: python3-nose >= 1.3
-BuildRequires: python3-parse >= 1.8.2
-BuildRequires: python3-parse_type >= 0.4.2
-BuildRequires: python3-path >= 10.1
-BuildRequires: python3-pyhamcrest >= 1.9
-BuildRequires: python3-pytest >= 3.0
-BuildRequires: python3-six >= 1.11
-%endif
-%endif
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
-%if %{with doc}
-BuildRequires: python3-sphinx_bootstrap_theme >= 0.6.0
-BuildRequires: sphinx-pdg-3 >= 1.6
-%endif
-Requires: python-modules >= 1:2.6
-BuildArch: noarch
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-behave is behavior-driven development, Python style.
-
-%description -l pl.UTF-8
-behave to programowanie sterowane zachowaniem, w stylu Pythona.
-
-%package -n python3-behave
-Summary: Behaviour-driven development, Python style
-Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
-Group: Libraries/Python
-Requires: python3-modules >= 1:3.4
-
-%description -n python3-behave
-behave is behavior-driven development, Python style.
-
-%description -n python3-behave -l pl.UTF-8
-behave to programowanie sterowane zachowaniem, w stylu Pythona.
-
-%package apidocs
-Summary: API documentation for Python behave module
-Summary(pl.UTF-8): Dokumentacja API modułu Pythona behave
-Group: Documentation
-
-%description apidocs
-API documentation for Python behave module.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API modułu Pythona behave.
-
-%prep
-%setup -q -n behave-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
-%patch -P 2 -p1
-%patch -P 3 -p1
-%patch -P 4 -p1
-%patch -P 5 -p1
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-# can't get test_text__with_raised_exception_and_bytes_message test to work
-# (LC_ALL=C.UTF-8 and PYTHONIOENCODING=utf-8 don't help)
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python} -m pytest tests -k 'not test_text__with_raised_exception_and_bytes_message'
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTHONPATH=$(pwd)/lib \
-%{__python3} -m pytest tests
-%endif
-%endif
-
-%if %{with doc}
-%{__make} -C docs html \
- SPHINXBUILD=sphinx-build-3
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-2}
-
-install -d $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
-# async_step requires python3.5+, don't install in python2 package
-cp -pr examples/env_vars $RPM_BUILD_ROOT%{_examplesdir}/python-behave-%{version}
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
-
-install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
-cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc CHANGES.rst LICENSE README.rst
-%attr(755,root,root) %{_bindir}/behave-2
-%{py_sitescriptdir}/behave
-%{py_sitescriptdir}/behave-%{version}-py*.egg-info
-%{py_sitescriptdir}/setuptools_behave.py[co]
-%{_examplesdir}/python-behave-%{version}
-%endif
-
-%if %{with python3}
-%files -n python3-behave
-%defattr(644,root,root,755)
-%doc CHANGES.rst LICENSE README.rst
-%attr(755,root,root) %{_bindir}/behave-3
-%{py3_sitescriptdir}/behave
-%{py3_sitescriptdir}/behave-%{version}-py*.egg-info
-%{py3_sitescriptdir}/setuptools_behave.py
-%{py3_sitescriptdir}/__pycache__/setuptools_behave.cpython-*.py[co]
-%{_examplesdir}/python3-behave-%{version}
-%endif
-
-%if %{with doc}
-%files apidocs
-%defattr(644,root,root,755)
-%doc build/docs/html/{_images,_static,*.html,*.js}
-%endif
diff --git a/python3-behave.spec b/python3-behave.spec
new file mode 100644
index 0000000..ccda1a0
--- /dev/null
+++ b/python3-behave.spec
@@ -0,0 +1,116 @@
+#
+# Conditional build:
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
+
+Summary: Behaviour-driven development, Python style
+Summary(pl.UTF-8): Programowanie sterowane zachowaniem - w stylu Pythona
+Name: python3-behave
+Version: 1.3.3
+Release: 1
+License: BSD
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/behave/
+Source0: https://files.pythonhosted.org/packages/source/b/behave/behave-%{version}.tar.gz
+# Source0-md5: b34d84ac11468e05584056fbdfe5bb85
+Patch0: behave-mock.patch
+URL: https://pypi.org/project/behave/
+BuildRequires: python3-build >= 0.5.1
+BuildRequires: python3-installer
+BuildRequires: python3-modules >= 1:3.9
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-assertpy >= 1.1
+BuildRequires: python3-chardet
+BuildRequires: python3-colorama >= 0.3.7
+BuildRequires: python3-cucumber-expressions >= 17.1.0
+BuildRequires: python3-cucumber-tag-expressions >= 4.1.0
+BuildRequires: python3-freezegun >= 1.5.1
+BuildRequires: python3-parse >= 1.18.0
+BuildRequires: python3-parse_type >= 0.6.0
+BuildRequires: python3-path >= 13.1.0
+BuildRequires: python3-pyhamcrest >= 2.0.2
+BuildRequires: python3-pytest >= 5.0
+BuildRequires: python3-pytest-html >= 2.0
+BuildRequires: python3-pytest-metadata
+BuildRequires: python3-six >= 1.15.0
+%if "%{_ver_lt %{py3_ver} 3.11}" == "1"
+BuildRequires: python3-tomli >= 1.1.0
+%endif
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 2.044
+%if %{with doc}
+BuildRequires: python3-furo >= 2024.4.27
+BuildRequires: python3-sphinx_bootstrap_theme >= 0.6.0
+BuildRequires: python3-sphinx_copybutton >= 0.5.2
+BuildRequires: sphinx-pdg-3 >= 7.4.0
+%endif
+Requires: python3-modules >= 1:3.9
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+behave is behavior-driven development, Python style.
+
+%description -l pl.UTF-8
+behave to programowanie sterowane zachowaniem, w stylu Pythona.
+
+%package apidocs
+Summary: API documentation for Python behave module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona behave
+Group: Documentation
+
+%description apidocs
+API documentation for Python behave module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona behave.
+
+%prep
+%setup -q -n behave-%{version}
+%patch -P0 -p1
+
+%build
+%py3_build_pyproject
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_html.plugin,pytest_metadata.plugin \
+PYTHONPATH=$(pwd)/lib \
+%{__python3} -m pytest tests
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install_pyproject
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/{behave,behave-3}
+ln -sf behave-3 $RPM_BUILD_ROOT%{_bindir}/behave
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
+cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-behave-%{version}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES.rst LICENSE README.rst
+%attr(755,root,root) %{_bindir}/behave-3
+%{_bindir}/behave
+%{py3_sitescriptdir}/behave
+%{py3_sitescriptdir}/behave-%{version}.dist-info
+%{_examplesdir}/python3-behave-%{version}
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc build/docs/html/en/{_images,_static,*.html,*.js}
+%endif
diff --git a/behave-backport-for-py38-fixes.patch b/behave-backport-for-py38-fixes.patch
deleted file mode 100644
index fcb26f2..0000000
--- a/behave-backport-for-py38-fixes.patch
+++ /dev/null
@@ -1,573 +0,0 @@
-From 72257e2db209f60626e43a1335e656f868b72935 Mon Sep 17 00:00:00 2001
-From: Petr Schindler <pschindl at redhat.com>
-Date: Fri, 20 Sep 2019 08:38:18 +0200
-Subject: [PATCH] Backport for py38 fixes
-
-Cherry picked from commits:
-83906ba779956af9437defcb8975debb18440e0d
-ce8f2eddd832b34fb4f628d898383db16f5c92ed
-e69d28ea8ce3bf361b278bfe5e10cafa6bdf6760
-c000c88eb5239b87f299c85e83b349b0ef387ae7
-
----
- behave.ini | 3 +-
- features/environment.py | 14 ++++++
- features/step.duplicated_step.feature | 20 ++++----
- issue.features/environment.py | 38 ++++++++++++---
- issue.features/issue0330.feature | 64 ++++++++++++++++++++++++
- issue.features/issue0446.feature | 70 +++++++++++++++++++++++++++
- issue.features/issue0457.feature | 49 +++++++++++++++++++
- test/test_runner.py | 6 +++
- tests/api/_test_async_step34.py | 9 ++--
- tests/unit/test_capture.py | 2 +
- tox.ini | 2 +-
- 11 files changed, 255 insertions(+), 22 deletions(-)
-
-diff --git a/behave.ini b/behave.ini
-index 431956d..1a18843 100644
---- a/behave.ini
-+++ b/behave.ini
-@@ -15,8 +15,9 @@ show_skipped = false
- format = rerun
- progress3
- outfiles = rerun.txt
-- reports/report_progress3.txt
-+ build/behave.reports/report_progress3.txt
- junit = true
-+junit_directory = build/behave.reports
- logging_level = INFO
- # logging_format = LOG.%(levelname)-8s %(name)-10s: %(message)s
- # logging_format = LOG.%(levelname)-8s %(asctime)s %(name)-10s: %(message)s
-diff --git a/features/environment.py b/features/environment.py
-index 4744e89..3769ee4 100644
---- a/features/environment.py
-+++ b/features/environment.py
-@@ -1,5 +1,7 @@
- # -*- coding: UTF-8 -*-
-+# FILE: features/environemnt.py
-
-+from __future__ import absolute_import, print_function
- from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values
- from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
- import platform
-@@ -20,6 +22,15 @@ active_tag_value_provider = {
- }
- active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)
-
-+
-+def print_active_tags_summary():
-+ active_tag_data = active_tag_value_provider
-+ print("ACTIVE-TAG SUMMARY:")
-+ print("use.with_python.version=%s" % active_tag_data.get("python.version"))
-+ # print("use.with_os=%s" % active_tag_data.get("os"))
-+ print()
-+
-+
- # -----------------------------------------------------------------------------
- # HOOKS:
- # -----------------------------------------------------------------------------
-@@ -30,11 +41,14 @@ def before_all(context):
- setup_python_path()
- setup_context_with_global_params_test(context)
- setup_command_shell_processors4behave()
-+ print_active_tags_summary()
-+
-
- def before_feature(context, feature):
- if active_tag_matcher.should_exclude_with(feature.tags):
- feature.skip(reason=active_tag_matcher.exclude_reason)
-
-+
- def before_scenario(context, scenario):
- if active_tag_matcher.should_exclude_with(scenario.effective_tags):
- scenario.skip(reason=active_tag_matcher.exclude_reason)
-diff --git a/features/step.duplicated_step.feature b/features/step.duplicated_step.feature
-index 59888b0..396cca2 100644
---- a/features/step.duplicated_step.feature
-+++ b/features/step.duplicated_step.feature
-@@ -32,11 +32,11 @@ Feature: Duplicated Step Definitions
- AmbiguousStep: @given('I call Alice') has already been defined in
- existing step @given('I call Alice') at features/steps/alice_steps.py:3
- """
-- And the command output should contain:
-- """
-- File "features/steps/alice_steps.py", line 7, in <module>
-- @given(u'I call Alice')
-- """
-+ # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
-+ # And the command output should contain:
-+ # """
-+ # File "features/steps/alice_steps.py", line 7, in <module>
-+ # """
-
-
- Scenario: Duplicated Step Definition in another File
-@@ -70,11 +70,11 @@ Feature: Duplicated Step Definitions
- AmbiguousStep: @given('I call Bob') has already been defined in
- existing step @given('I call Bob') at features/steps/bob1_steps.py:3
- """
-- And the command output should contain:
-- """
-- File "features/steps/bob2_steps.py", line 3, in <module>
-- @given('I call Bob')
-- """
-+ # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
-+ # And the command output should contain:
-+ # """
-+ # File "features/steps/bob2_steps.py", line 3, in <module>
-+ # """
-
- @xfail
- Scenario: Duplicated Same Step Definition via import from another File
-diff --git a/issue.features/environment.py b/issue.features/environment.py
-index 3737155..dc8a7fb 100644
---- a/issue.features/environment.py
-+++ b/issue.features/environment.py
-@@ -1,5 +1,5 @@
- # -*- coding: UTF-8 -*-
--# FILE: features/environment.py
-+# FILE: issue.features/environemnt.py
- # pylint: disable=unused-argument
- """
- Functionality:
-@@ -7,17 +7,20 @@ Functionality:
- * active tags
- """
-
--from __future__ import print_function
-+
-+from __future__ import absolute_import, print_function
- import sys
- import platform
- import os.path
- import six
- from behave.tag_matcher import ActiveTagMatcher
- from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
--# PREPARED:
--# from behave.tag_matcher import setup_active_tag_values
-+# PREPARED: from behave.tag_matcher import setup_active_tag_values
-
-
-+# ---------------------------------------------------------------------------
-+# TEST SUPPORT: For Active Tags
-+# ---------------------------------------------------------------------------
- def require_tool(tool_name):
- """Check if a tool (an executable program) is provided on this platform.
-
-@@ -45,12 +48,14 @@ def require_tool(tool_name):
- # print("TOOL-NOT-FOUND: %s" % tool_name)
- return False
-
-+
- def as_bool_string(value):
- if bool(value):
- return "yes"
- else:
- return "no"
-
-+
- def discover_ci_server():
- # pylint: disable=invalid-name
- ci_server = "none"
-@@ -67,11 +72,16 @@ def discover_ci_server():
- return ci_server
-
-
-+# ---------------------------------------------------------------------------
-+# BEHAVE SUPPORT: Active Tags
-+# ---------------------------------------------------------------------------
- # -- MATCHES ANY TAGS: @use.with_{category}={value}
- # NOTE: active_tag_value_provider provides category values for active tags.
-+python_version = "%s.%s" % sys.version_info[:2]
- active_tag_value_provider = {
- "python2": str(six.PY2).lower(),
- "python3": str(six.PY3).lower(),
-+ "python.version": python_version,
- # -- python.implementation: cpython, pypy, jython, ironpython
- "python.implementation": platform.python_implementation().lower(),
- "pypy": str("__pypy__" in sys.modules).lower(),
-@@ -81,17 +91,33 @@ active_tag_value_provider = {
- }
- active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)
-
-+
-+def print_active_tags_summary():
-+ active_tag_data = active_tag_value_provider
-+ print("ACTIVE-TAG SUMMARY:")
-+ print("use.with_python.version=%s" % active_tag_data.get("python.version"))
-+ # print("use.with_platform=%s" % active_tag_data.get("platform"))
-+ # print("use.with_os=%s" % active_tag_data.get("os"))
-+ print()
-+
-+
-+# ---------------------------------------------------------------------------
-+# BEHAVE HOOKS:
-+# ---------------------------------------------------------------------------
- def before_all(context):
- # -- SETUP ACTIVE-TAG MATCHER (with userdata):
- # USE: behave -D browser=safari ...
-- # NOT-NEEDED: setup_active_tag_values(active_tag_value_provider,
-- # context.config.userdata)
-+ # NOT-NEEDED:
-+ # setup_active_tag_values(active_tag_value_provider, context.config.userdata)
- setup_command_shell_processors4behave()
-+ print_active_tags_summary()
-+
-
- def before_feature(context, feature):
- if active_tag_matcher.should_exclude_with(feature.tags):
- feature.skip(reason=active_tag_matcher.exclude_reason)
-
-+
- def before_scenario(context, scenario):
- if active_tag_matcher.should_exclude_with(scenario.effective_tags):
- scenario.skip(reason=active_tag_matcher.exclude_reason)
-diff --git a/issue.features/issue0330.feature b/issue.features/issue0330.feature
-index dc1ebe7..81cb6e2 100644
---- a/issue.features/issue0330.feature
-+++ b/issue.features/issue0330.feature
-@@ -70,6 +70,7 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
- And note that "bob.feature is skipped"
-
-
-+ @not.with_python.version=3.8
- Scenario: Junit report for skipped feature is created with --show-skipped
- When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
- Then it should pass with:
-@@ -83,6 +84,23 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
- <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
- """
-
-+ @use.with_python.version=3.8
-+ Scenario: Junit report for skipped feature is created with --show-skipped
-+ When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
-+ Then it should pass with:
-+ """
-+ 1 feature passed, 0 failed, 1 skipped
-+ """
-+ And a file named "test_results/TESTS-alice.xml" exists
-+ And a file named "test_results/TESTS-bob.xml" exists
-+ And the file "test_results/TESTS-bob.xml" should contain:
-+ """
-+ <testsuite name="bob.Bob" tests="1" errors="0" failures="0" skipped="1" time="0.0">
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
-+
-+ @not.with_python.version=3.8
- Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
- When I run "behave --junit -t @tag1 --no-skipped"
- Then it should pass with:
-@@ -102,7 +120,30 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
- """
- And note that "Charly2 is the skipped scenarion in charly.feature"
-
-+ @use.with_python.version=3.8
-+ Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
-+ When I run "behave --junit -t @tag1 --no-skipped"
-+ Then it should pass with:
-+ """
-+ 2 features passed, 0 failed, 1 skipped
-+ 2 scenarios passed, 0 failed, 2 skipped
-+ """
-+ And a file named "test_results/TESTS-alice.xml" exists
-+ And a file named "test_results/TESTS-charly.xml" exists
-+ And the file "test_results/TESTS-charly.xml" should contain:
-+ """
-+ <testsuite name="charly.Charly" tests="1" errors="0" failures="0" skipped="0"
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <testsuite errors="0" failures="0" name="charly.Charly" skipped="0" tests="1"
-+ And the file "test_results/TESTS-charly.xml" should not contain:
-+ """
-+ <testcase classname="charly.Charly" name="Charly2"
-+ """
-+ And note that "Charly2 is the skipped scenarion in charly.feature"
-+
-
-+ @not.with_python.version=3.8
- Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
- When I run "behave --junit -t @tag1 --show-skipped"
- Then it should pass with:
-@@ -122,3 +163,26 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
- """
- And note that "Charly2 is the skipped scenarion in charly.feature"
-
-+
-+ @use.with_python.version=3.8
-+ Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
-+ When I run "behave --junit -t @tag1 --show-skipped"
-+ Then it should pass with:
-+ """
-+ 2 features passed, 0 failed, 1 skipped
-+ 2 scenarios passed, 0 failed, 2 skipped
-+ """
-+ And a file named "test_results/TESTS-alice.xml" exists
-+ And a file named "test_results/TESTS-charly.xml" exists
-+ And the file "test_results/TESTS-charly.xml" should contain:
-+ """
-+ <testsuite name="charly.Charly" tests="2" errors="0" failures="0" skipped="1"
-+ """
-+ # HINT: Python < 3.8
-+ # <testsuite errors="0" failures="0" name="charly.Charly" skipped="1" tests="2"
-+ And the file "test_results/TESTS-charly.xml" should contain:
-+ """
-+ <testcase classname="charly.Charly" name="Charly2" status="skipped"
-+ """
-+ And note that "Charly2 is the skipped scenarion in charly.feature"
-+
-diff --git a/issue.features/issue0446.feature b/issue.features/issue0446.feature
-index a2ed892..901bdec 100644
---- a/issue.features/issue0446.feature
-+++ b/issue.features/issue0446.feature
-@@ -58,6 +58,7 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
- behave.reporter.junit.show_hostname = False
- """
-
-+ @not.with_python.version=3.8
- Scenario: Hook error in before_scenario()
- When I run "behave -f plain --junit features/before_scenario_failure.feature"
- Then it should fail with:
-@@ -86,6 +87,40 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
- And note that "the traceback is contained in the XML element <error/>"
-
-
-+ @use.with_python.version=3.8
-+ Scenario: Hook error in before_scenario()
-+ When I run "behave -f plain --junit features/before_scenario_failure.feature"
-+ Then it should fail with:
-+ """
-+ 0 scenarios passed, 1 failed, 0 skipped
-+ """
-+ And the command output should contain:
-+ """
-+ HOOK-ERROR in before_scenario: RuntimeError: OOPS
-+ """
-+ And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+ """
-+ <testsuite name="before_scenario_failure.Alice" tests="1" errors="1" failures="0" skipped="0"
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <testsuite errors="1" failures="0" name="before_scenario_failure.Alice" skipped="0" tests="1"
-+ And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+ """
-+ <error type="RuntimeError" message="HOOK-ERROR in before_scenario: RuntimeError: OOPS">
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <error message="HOOK-ERROR in before_scenario: RuntimeError: OOPS" type="RuntimeError">
-+ And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+ """
-+ File "features/environment.py", line 6, in before_scenario
-+ cause_hook_failure()
-+ File "features/environment.py", line 2, in cause_hook_failure
-+ raise RuntimeError("OOPS")
-+ """
-+ And note that "the traceback is contained in the XML element <error/>"
-+
-+
-+ @not.with_python.version=3.8
- Scenario: Hook error in after_scenario()
- When I run "behave -f plain --junit features/after_scenario_failure.feature"
- Then it should fail with:
-@@ -114,3 +149,38 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
- raise RuntimeError("OOPS")
- """
- And note that "the traceback is contained in the XML element <error/>"
-+
-+
-+ @use.with_python.version=3.8
-+ Scenario: Hook error in after_scenario()
-+ When I run "behave -f plain --junit features/after_scenario_failure.feature"
-+ Then it should fail with:
-+ """
-+ 0 scenarios passed, 1 failed, 0 skipped
-+ """
-+ And the command output should contain:
-+ """
-+ Scenario: B1
-+ Given another step passes ... passed
-+ HOOK-ERROR in after_scenario: RuntimeError: OOPS
-+ """
-+ And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+ """
-+ <testsuite name="after_scenario_failure.Bob" tests="1" errors="1" failures="0" skipped="0"
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <testsuite errors="1" failures="0" name="after_scenario_failure.Bob" skipped="0" tests="1"
-+ And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+ """
-+ <error type="RuntimeError" message="HOOK-ERROR in after_scenario: RuntimeError: OOPS">
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <error message="HOOK-ERROR in after_scenario: RuntimeError: OOPS" type="RuntimeError">
-+ And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+ """
-+ File "features/environment.py", line 10, in after_scenario
-+ cause_hook_failure()
-+ File "features/environment.py", line 2, in cause_hook_failure
-+ raise RuntimeError("OOPS")
-+ """
-+ And note that "the traceback is contained in the XML element <error/>"
-diff --git a/issue.features/issue0457.feature b/issue.features/issue0457.feature
-index f80640e..46f96e9 100644
---- a/issue.features/issue0457.feature
-+++ b/issue.features/issue0457.feature
-@@ -24,6 +24,7 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
- """
-
-
-+ @not.with_python.version=3.8
- Scenario: Use failing assertation in a JUnit XML report
- Given a file named "features/fails1.feature" with:
- """
-@@ -44,6 +45,31 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
- <failure message="FAILED: My name is "Alice""
- """
-
-+ @use.with_python.version=3.8
-+ Scenario: Use failing assertation in a JUnit XML report
-+ Given a file named "features/fails1.feature" with:
-+ """
-+ Feature:
-+ Scenario: Alice
-+ Given a step fails with message:
-+ '''
-+ My name is "Alice"
-+ '''
-+ """
-+ When I run "behave --junit features/fails1.feature"
-+ Then it should fail with:
-+ """
-+ 0 scenarios passed, 1 failed, 0 skipped
-+ """
-+ And the file "reports/TESTS-fails1.xml" should contain:
-+ """
-+ <failure type="AssertionError" message="FAILED: My name is "Alice"">
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <failure message="FAILED: My name is "Alice""
-+
-+
-+ @not.with_python.version=3.8
- Scenario: Use exception in a JUnit XML report
- Given a file named "features/fails2.feature" with:
- """
-@@ -63,3 +89,26 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
- """
- <error message="My name is "Bob" and <here> I am"
- """
-+
-+ @use.with_python.version=3.8
-+ Scenario: Use exception in a JUnit XML report
-+ Given a file named "features/fails2.feature" with:
-+ """
-+ Feature:
-+ Scenario: Bob
-+ Given a step fails with error and message:
-+ '''
-+ My name is "Bob" and <here> I am
-+ '''
-+ """
-+ When I run "behave --junit features/fails2.feature"
-+ Then it should fail with:
-+ """
-+ 0 scenarios passed, 1 failed, 0 skipped
-+ """
-+ And the file "reports/TESTS-fails2.xml" should contain:
-+ """
-+ <error type="RuntimeError" message="My name is "Bob" and <here> I am">
-+ """
-+ # -- HINT FOR: Python < 3.8
-+ # <error message="My name is "Bob" and <here> I am"
-diff --git a/test/test_runner.py b/test/test_runner.py
-index 70a7002..1b5afa2 100644
---- a/test/test_runner.py
-+++ b/test/test_runner.py
-@@ -286,6 +286,7 @@ class TestContext(unittest.TestCase):
- eq_("thing" in self.context, True)
- del self.context.thing
-
-+
- class ExampleSteps(object):
- text = None
- table = None
-@@ -320,6 +321,7 @@ class ExampleSteps(object):
- for keyword, pattern, func in step_definitions:
- step_registry.add_step_definition(keyword, pattern, func)
-
-+
- class TestContext_ExecuteSteps(unittest.TestCase):
- """
- Test the behave.runner.Context.execute_steps() functionality.
-@@ -341,6 +343,8 @@ class TestContext_ExecuteSteps(unittest.TestCase):
- runner_.config.stdout_capture = False
- runner_.config.stderr_capture = False
- runner_.config.log_capture = False
-+ runner_.config.logging_format = None
-+ runner_.config.logging_datefmt = None
- runner_.step_registry = self.step_registry
-
- self.context = runner.Context(runner_)
-@@ -658,6 +662,8 @@ class TestRunWithPaths(unittest.TestCase):
- self.config.logging_filter = None
- self.config.outputs = [Mock(), StreamOpener(stream=sys.stdout)]
- self.config.format = ["plain", "progress"]
-+ self.config.logging_format = None
-+ self.config.logging_datefmt = None
- self.runner = runner.Runner(self.config)
- self.load_hooks = self.runner.load_hooks = Mock()
- self.load_step_definitions = self.runner.load_step_definitions = Mock()
-diff --git a/tests/api/_test_async_step34.py b/tests/api/_test_async_step34.py
-index c93fb74..4e4edf4 100644
---- a/tests/api/_test_async_step34.py
-+++ b/tests/api/_test_async_step34.py
-@@ -37,15 +37,16 @@ from .testing_support_async import AsyncStepTheory
- # -----------------------------------------------------------------------------
- # TEST MARKERS:
- # -----------------------------------------------------------------------------
--python_version = float("%s.%s" % sys.version_info[:2])
-+# DEPRECATED: @asyncio.coroutine decorator (since: Python >= 3.8)
-+_python_version = float("%s.%s" % sys.version_info[:2])
-+requires_py34_to_py37 = pytest.mark.skipif(not (3.4 <= _python_version < 3.8),
-+ reason="Supported only for python.versions: 3.4 .. 3.7 (inclusive)")
-
--# xfail = pytest.mark.xfail
--py34_or_newer = pytest.mark.skipif(python_version < 3.4, reason="Needs Python >= 3.4")
-
- # -----------------------------------------------------------------------------
- # TESTSUITE:
- # -----------------------------------------------------------------------------
-- at py34_or_newer
-+ at requires_py34_to_py37
- class TestAsyncStepDecorator34(object):
-
- def test_step_decorator_async_run_until_complete2(self):
-diff --git a/tests/unit/test_capture.py b/tests/unit/test_capture.py
-index ac2655e..d9a3f3a 100644
---- a/tests/unit/test_capture.py
-+++ b/tests/unit/test_capture.py
-@@ -20,6 +20,8 @@ def create_capture_controller(config=None):
- config.log_capture = True
- config.logging_filter = None
- config.logging_level = "INFO"
-+ config.logging_format = "%(levelname)s:%(name)s:%(message)s"
-+ config.logging_datefmt = None
- return CaptureController(config)
-
- def setup_capture_controller(capture_controller, context=None):
-diff --git a/tox.ini b/tox.ini
-index 92f6679..16a392c 100644
---- a/tox.ini
-+++ b/tox.ini
-@@ -28,7 +28,7 @@
-
- [tox]
- minversion = 2.3
--envlist = py26, py27, py33, py34, py35, py36, pypy, docs
-+envlist = py26, py27, py33, py34, py35, py36, py37, py38, pypy, docs
- skip_missing_interpreters = True
- sitepackages = False
- indexserver =
---
-2.23.0
-
diff --git a/behave-drop_2to3.patch b/behave-drop_2to3.patch
deleted file mode 100644
index 370ff43..0000000
--- a/behave-drop_2to3.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- behave-1.2.6/setup.py.orig 2018-02-25 17:27:09.000000000 +0100
-+++ behave-1.2.6/setup.py 2023-10-22 09:06:13.799948986 +0200
-@@ -100,8 +100,6 @@ setup(
- "pylint",
- ],
- },
-- # MAYBE-DISABLE: use_2to3
-- use_2to3= bool(python_version >= 3.0),
- license="BSD",
- classifiers=[
- "Development Status :: 4 - Beta",
diff --git a/behave-invalid-escape-seq.patch b/behave-invalid-escape-seq.patch
deleted file mode 100644
index ef80a16..0000000
--- a/behave-invalid-escape-seq.patch
+++ /dev/null
@@ -1,82 +0,0 @@
---- a/behave4cmd0/command_shell_proc.py
-+++ b/behave4cmd0/command_shell_proc.py
-@@ -251,6 +251,6 @@
- "No such file or directory: '(?P<path>.*)'",
- "[Errno 2] No such file or directory:"), # IOError
- ExceptionWithPathNormalizer(
-- '^\s*File "(?P<path>.*)", line \d+, in ',
-+ r'^\s*File "(?P<path>.*)", line \d+, in ',
- 'File "'),
- ]
---- a/tests/unit/test_behave4cmd_command_shell_proc.py
-+++ b/tests/unit/test_behave4cmd_command_shell_proc.py
-@@ -1,5 +1,5 @@
- # -*- coding: UTF-8 -*-
--"""
-+r"""
-
- Regular expressions for winpath:
- http://regexlib.com/Search.aspx?k=file+name
-@@ -61,7 +61,7 @@ def __call__(self, output):
-
- line_processor_traceback = [
- ExceptionWithPathNormalizer(
-- '^\s*File "(?P<path>.*)", line \d+, in ',
-+ r'^\s*File "(?P<path>.*)", line \d+, in ',
- ' File "'),
- BehaveWinCommandOutputProcessor.line_processors[4],
- ]
---- a/tests/issues/test_issue0336.py
-+++ b/tests/issues/test_issue0336.py
-@@ -52,6 +52,7 @@ def test_issue__with_default_encoding(self):
- assert file_line_text in text2
-
- # @require_python2
-+ @pytest.mark.filterwarnings("ignore:invalid escape sequence")
- def test__problem_exists_with_problematic_encoding(self):
- """Test ensures that problem exists with encoding=unicode-escape"""
- # -- NOTE: Explicit use of problematic encoding
---- a/tests/issues/test_issue0495.py
-+++ b/tests/issues/test_issue0495.py
-@@ -46,7 +46,7 @@
- def test_issue(log_message):
- @capture(level=logging.INFO)
- def hook_after_scenario(context, message):
-- logging.warn(message)
-+ logging.warning(message)
- raise RuntimeError()
-
- # -- PREPARE:
---- a/test/test_parser.py
-+++ b/test/test_parser.py
-@@ -2,7 +2,7 @@
-
- from __future__ import absolute_import
- from nose.tools import *
--
-+import pytest
- from behave import i18n, model, parser
-
- class Common(object):
-@@ -529,16 +529,17 @@
- ('then', 'Then', 'stuff is in buckets', None, None),
- ])
-
-+ @pytest.mark.filterwarnings("ignore:invalid escape sequence")
- def test_parses_feature_with_table_and_escaped_pipe_in_cell_values(self):
- doc = u'''
- Feature:
- Scenario:
- Given we have special cell values:
- | name | value |
-- | alice | one\|two |
-- | bob |\|one |
-- | charly | one\||
-- | doro | one\|two\|three\|four |
-+ | alice | one\\|two |
-+ | bob |\\|one |
-+ | charly | one\\||
-+ | doro | one\\|two\\|three\\|four |
- '''.lstrip()
- feature = parser.parse_feature(doc)
- assert(len(feature.scenarios) == 1)
diff --git a/behave-mock.patch b/behave-mock.patch
new file mode 100644
index 0000000..99fa442
--- /dev/null
+++ b/behave-mock.patch
@@ -0,0 +1,187 @@
+--- behave-1.3.3/tests/api/_test_async_step35.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/api/_test_async_step35.py 2026-03-12 20:26:59.903449526 +0100
+@@ -24,7 +24,7 @@ from platform import python_implementati
+ import sys
+
+ from hamcrest import assert_that, close_to
+-from mock import Mock
++from unittest.mock import Mock
+ import pytest
+
+ from behave._stepimport import use_step_import_modules, SimpleStepContainer
+--- behave-1.3.3/tests/unit/test_context_cleanups.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_context_cleanups.py 2026-03-12 20:31:08.358770195 +0100
+@@ -13,7 +13,7 @@ OPEN ISSUES:
+ from __future__ import print_function
+ from behave.configuration import Configuration
+ from behave.runner import Context, Runner, scoped_context_layer
+-from mock import Mock
++from unittest.mock import Mock
+ import pytest
+
+
+--- behave-1.3.3/tests/functional/test_capture_on_failed.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/functional/test_capture_on_failed.py 2026-03-12 20:56:28.267202811 +0100
+@@ -5,7 +5,7 @@ if the TEST ASSUMPTION, that is used her
+ * TEST ASSUMPTION: STORE_CAPTURED_ON_SUCCESS is False (only failures are captured)
+ """
+
+-from mock import Mock
++from unittest.mock import Mock
+ import pytest
+
+ from behave.configuration import Configuration
+--- behave-1.3.3/tests/functional/test_capture_on_success.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/functional/test_capture_on_success.py 2026-03-12 20:56:48.940424147 +0100
+@@ -5,7 +5,7 @@ if the TEST ASSUMPTION, that is used her
+ * TEST ASSUMPTION: STORE_CAPTURED_ON_SUCCESS is True (everything is captured)
+ """
+
+-from mock import Mock
++from unittest.mock import Mock
+ import pytest
+
+ from behave.configuration import Configuration
+--- behave-1.3.3/tests/issues/test_issue0619.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/issues/test_issue0619.py 2026-03-12 20:57:16.560274518 +0100
+@@ -20,7 +20,7 @@ so the default behaviour of getattr is n
+ from __future__ import absolute_import
+ from behave.configuration import Configuration
+ from behave.runner import Context, scoped_context_layer
+-from mock import Mock
++from unittest.mock import Mock
+
+
+ def test_issue__getattr_with_protected_unknown_context_attribute_raises_no_error():
+--- behave-1.3.3/tests/issues/test_issue0767.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/issues/test_issue0767.py 2026-03-12 20:57:31.086862487 +0100
+@@ -14,7 +14,7 @@ Behave returns nothing. ::
+ This seems to be an oversight.
+ """
+
+-from mock import Mock
++from unittest.mock import Mock
+ from behave.fixture import fixture, use_fixture_by_tag
+ from behave.runner import Context
+
+--- behave-1.3.3/tests/unit/reporter/test_summary.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/reporter/test_summary.py 2026-03-12 20:57:46.920110044 +0100
+@@ -1,7 +1,7 @@
+ # -*- coding: UTF-8 -*-
+
+ from __future__ import absolute_import, print_function, division
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from behave.model import ScenarioOutline
+ from behave.model_type import Status
+ from behave.reporter.summary import (
+--- behave-1.3.3/tests/unit/test_deprecated.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_deprecated.py 2026-03-12 20:58:04.470014968 +0100
+@@ -11,7 +11,7 @@ from behave.configuration import Configu
+ from behave.python_feature import PythonFeature
+ from behave.runner import Context, ModelRunner
+ from behave.tag_matcher import ActiveTagMatcher
+-from mock import Mock
++from unittest.mock import Mock
+ import pytest
+
+
+--- behave-1.3.3/tests/unit/test_formatter.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_formatter.py 2026-03-12 20:58:19.429933924 +0100
+@@ -6,7 +6,7 @@ import sys
+ import tempfile
+ import unittest
+ import six
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from behave.formatter._registry import make_formatters
+ from behave.formatter import pretty
+ from behave.formatter.base import StreamOpener
+--- behave-1.3.3/tests/unit/test_log_capture.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_log_capture.py 2026-03-12 20:59:44.296140831 +0100
+@@ -1,6 +1,6 @@
+ # -*- coding: UTF-8 -*-
+ from __future__ import absolute_import, with_statement
+-from mock import patch
++from unittest.mock import patch
+ from behave.log_capture import LoggingCapture
+ from six.moves import range
+
+--- behave-1.3.3/tests/unit/test_matchers.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_matchers.py 2026-03-12 21:09:10.396407336 +0100
+@@ -2,7 +2,7 @@
+ # ruff: noqa: E731
+ from __future__ import absolute_import, with_statement
+ import pytest
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ import parse
+ from behave.exception import NotSupportedWarning
+ from behave.matchers import (
+--- behave-1.3.3/tests/unit/test_model.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_model.py 2026-03-12 21:09:29.369637882 +0100
+@@ -4,7 +4,7 @@
+ from __future__ import absolute_import, print_function, with_statement
+ import unittest
+ import pytest
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ import six
+ from six.moves import range # pylint: disable=redefined-builtin
+ from six.moves import zip # pylint: disable=redefined-builtin
+--- behave-1.3.3/tests/unit/test_runner.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_runner.py 2026-03-12 21:09:45.286218321 +0100
+@@ -8,7 +8,7 @@ import sys
+ import unittest
+ from six import StringIO
+ import pytest
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from behave import runner_util
+ from behave.runner import Context, Runner
+ from behave.exception import ConfigError
+--- behave-1.3.3/tests/unit/test_runner_context.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_runner_context.py 2026-03-12 21:10:04.279448760 +0100
+@@ -7,7 +7,7 @@ import unittest
+ import warnings
+ from platform import python_implementation
+
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ import pytest
+ import six
+
+--- behave-1.3.3/tests/unit/test_runner_hook.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_runner_hook.py 2026-03-12 21:10:19.776031474 +0100
+@@ -3,7 +3,7 @@ Tests for :mod:`behave.runner` related t
+ """
+
+ from __future__ import absolute_import, print_function
+-from mock import Mock
++from unittest.mock import Mock
+ from behave.capture import CaptureSinkAsCollector
+ from behave.configuration import Configuration
+ from behave.runner import Context, ModelRunner
+--- behave-1.3.3/tests/unit/test_step_registry.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_step_registry.py 2026-03-12 21:10:33.385957743 +0100
+@@ -3,7 +3,7 @@
+ # ruff: noqa: E731
+
+ from __future__ import absolute_import, with_statement
+-from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from six.moves import range # pylint: disable=redefined-builtin
+ from behave import step_registry
+
+--- behave-1.3.3/tests/unit/test_tag_matcher.py.orig 2025-09-04 14:11:34.000000000 +0200
++++ behave-1.3.3/tests/unit/test_tag_matcher.py 2026-03-12 21:11:40.115596237 +0100
+@@ -9,8 +9,8 @@ Unit tests for active tag-matcher (mod:`
+ """
+
+ from __future__ import absolute_import
+-from mock import Mock
+ from unittest import TestCase
++from unittest.mock import Mock
+ import operator
+ import pytest
+
diff --git a/behave-sphinx-extlinks.patch b/behave-sphinx-extlinks.patch
deleted file mode 100644
index 72a1419..0000000
--- a/behave-sphinx-extlinks.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/docs/conf.py 2023-03-23 09:30:01.556715659 +0200
-+++ b/docs/conf.py 2023-03-23 11:16:25.561357857 +0200
-@@ -44,8 +44,8 @@
-
-
- extlinks = {
-- "pypi": ("https://pypi.python.org/pypi/%s", ""),
-- "github": ("https://github.com/%s", "github:/"),
-+ "pypi": ("https://pypi.python.org/pypi/%s", "%s"),
-+ "github": ("https://github.com/%s", "%s"),
- "issue": ("https://github.com/behave/behave/issue/%s", "issue #"),
- "youtube": ("https://www.youtube.com/watch?v=%s", "youtube:video="),
- "behave": ("https://github.com/behave/behave", None),
diff --git a/behave-tweak-tests-required-by-pytest-5.0.patch b/behave-tweak-tests-required-by-pytest-5.0.patch
deleted file mode 100644
index 8c8ea37..0000000
--- a/behave-tweak-tests-required-by-pytest-5.0.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From aa1d0c5358ac35a3f222bdf95cdb9f44eeb0427b Mon Sep 17 00:00:00 2001
-From: jenisys <jenisys at users.noreply.github.com>
-Date: Fri, 5 Jul 2019 08:27:44 +0200
-Subject: [PATCH] Tweak tests, required by pytest >= 5.0. With pytest.raises
- use str(e.value) instead of str(e) in some cases.
-
----
- tests/issues/test_issue0458.py | 2 +-
- tests/unit/test_context_cleanups.py | 2 +-
- tests/unit/test_textutil.py | 36 ++++++++++++++++++++---------
- 3 files changed, 27 insertions(+), 13 deletions(-)
-
-diff --git a/tests/issues/test_issue0458.py b/tests/issues/test_issue0458.py
-index 1853ad6..f66f6d3 100644
---- a/tests/issues/test_issue0458.py
-+++ b/tests/issues/test_issue0458.py
-@@ -48,7 +48,7 @@ def test_issue(exception_class, message):
- raise_exception(exception_class, message)
-
- # -- SHOULD NOT RAISE EXCEPTION HERE:
-- text = _text(e)
-+ text = _text(e.value)
- # -- DIAGNOSTICS:
- print(u"text"+ text)
- print(u"exception: %s" % e)
-diff --git a/tests/unit/test_context_cleanups.py b/tests/unit/test_context_cleanups.py
-index b0e8ae6..bf0ab50 100644
---- a/tests/unit/test_context_cleanups.py
-+++ b/tests/unit/test_context_cleanups.py
-@@ -153,7 +153,7 @@ class TestContextCleanup(object):
- with pytest.raises(AssertionError) as e:
- with scoped_context_layer(context):
- context.add_cleanup(non_callable)
-- assert "REQUIRES: callable(cleanup_func)" in str(e)
-+ assert "REQUIRES: callable(cleanup_func)" in str(e.value)
-
- def test_on_cleanup_error__prints_error_by_default(self, capsys):
- def bad_cleanup_func():
-diff --git a/tests/unit/test_textutil.py b/tests/unit/test_textutil.py
-index 3728c38..77e800f 100644
---- a/tests/unit/test_textutil.py
-+++ b/tests/unit/test_textutil.py
-@@ -212,9 +212,11 @@ class TestObjectToTextConversion(object):
- with pytest.raises(AssertionError) as e:
- assert False, message
-
-- text2 = text(e)
-- expected = u"AssertionError: %s" % message
-- assert text2.endswith(expected)
-+ # -- FOR: pytest < 5.0
-+ # expected = u"AssertionError: %s" % message
-+ text2 = text(e.value)
-+ assert u"AssertionError" in text(e)
-+ assert message in text2, "OOPS: text=%r" % text2
-
- @requires_python2
- @pytest.mark.parametrize("message", [
-@@ -224,11 +226,20 @@ class TestObjectToTextConversion(object):
- # -- ONLY PYTHON2: Use case makes no sense for Python 3.
- bytes_message = message.encode(self.ENCODING)
- with pytest.raises(AssertionError) as e:
-- assert False, bytes_message
--
-- text2 = text(e)
-- expected = u"AssertionError: %s" % message
-- assert text2.endswith(expected)
-+ try:
-+ assert False, bytes_message
-+ except UnicodeDecodeError as uni_error:
-+ # -- SINCE: Python 2.7.15
-+ decode_error_occured = True
-+ expected_decode_error = "'ascii' codec can't decode byte 0xc3 in position 0"
-+ assert expected_decode_error in str(uni_error)
-+ assert False, bytes_message.decode(self.ENCODING)
-+
-+ # -- FOR: pytest < 5.0
-+ # expected = u"AssertionError: %s" % message
-+ print("decode_error_occured(ascii)=%s" % decode_error_occured)
-+ text2 = text(e.value)
-+ assert message in text2, "OOPS: text=%r" % text2
-
- @pytest.mark.parametrize("exception_class, message", [
- (AssertionError, u"Ärgernis"),
-@@ -240,10 +251,13 @@ class TestObjectToTextConversion(object):
- with pytest.raises(exception_class) as e:
- raise exception_class(message)
-
-- text2 = text(e)
-+ # -- FOR: pytest < 5.0
-+ # expected = u"AssertionError: %s" % message
-+ text2 = text(e.value)
- expected = u"%s: %s" % (exception_class.__name__, message)
- assert isinstance(text2, six.text_type)
-- assert text2.endswith(expected)
-+ assert exception_class.__name__ in str(e)
-+ assert message in text2, "OOPS: text=%r" % text2
-
- @requires_python2
- @pytest.mark.parametrize("exception_class, message", [
-@@ -257,7 +271,7 @@ class TestObjectToTextConversion(object):
- with pytest.raises(exception_class) as e:
- raise exception_class(bytes_message)
-
-- text2 = text(e)
-+ text2 = text(e.value)
- unicode_message = bytes_message.decode(self.ENCODING)
- expected = u"%s: %s" % (exception_class.__name__, unicode_message)
- assert isinstance(text2, six.text_type)
---
-2.26.2
-
diff --git a/python-behave-mock.patch b/python-behave-mock.patch
deleted file mode 100644
index fa5f3d4..0000000
--- a/python-behave-mock.patch
+++ /dev/null
@@ -1,56 +0,0 @@
---- behave-1.2.6/tests/api/_test_async_step34.py.orig 2018-02-25 16:53:03.000000000 +0100
-+++ behave-1.2.6/tests/api/_test_async_step34.py 2021-02-10 22:27:28.523843239 +0100
-@@ -9,7 +9,10 @@
- from behave._stepimport import use_step_import_modules
- from behave.runner import Context, Runner
- import sys
--from mock import Mock
-+try:
-+ from mock import Mock
-+except ImportError:
-+ from unittest.mock import Mock
- import pytest
-
- from .testing_support import StopWatch, SimpleStepContainer
---- behave-1.2.6/tests/unit/test_capture.py.orig 2021-02-10 22:27:45.683750276 +0100
-+++ behave-1.2.6/tests/unit/test_capture.py 2021-02-10 22:27:48.457068585 +0100
-@@ -6,7 +6,10 @@
- from __future__ import absolute_import, print_function
- import sys
- from behave.capture import Captured, CaptureController
--from mock import Mock
-+try:
-+ from mock import Mock
-+except ImportError:
-+ from unittest.mock import Mock
- import pytest
-
- # -----------------------------------------------------------------------------
---- behave-1.2.6/tests/unit/test_context_cleanups.py.orig 2018-02-25 16:53:03.000000000 +0100
-+++ behave-1.2.6/tests/unit/test_context_cleanups.py 2021-02-10 22:28:05.466976435 +0100
-@@ -13,7 +13,10 @@
- from __future__ import print_function
- from behave.runner import Context, scoped_context_layer
- from contextlib import contextmanager
--from mock import Mock, NonCallableMock
-+try:
-+ from mock import Mock, NonCallableMock
-+except ImportError:
-+ from unittest.mock import Mock, NonCallableMock
- import pytest
-
-
---- behave-1.2.6/tests/unit/test_fixture.py.orig 2018-02-25 16:53:03.000000000 +0100
-+++ behave-1.2.6/tests/unit/test_fixture.py 2021-02-10 22:28:19.853565163 +0100
-@@ -12,7 +12,10 @@
- from behave.runner import Context, CleanupError, scoped_context_layer
- from behave._types import Unknown
- import pytest
--from mock import Mock
-+try:
-+ from mock import Mock
-+except ImportError:
-+ from unittest.mock import Mock
- import six
-
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-behave.git/commitdiff/7735dfa1184b2272d1bbbeede7fa8c2d81820ca4
More information about the pld-cvs-commit
mailing list