Hello community,

here is the log from the commit of package python-pytest-bdd for 
openSUSE:Factory checked in at 2020-06-10 00:49:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-bdd (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-bdd.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-bdd"

Wed Jun 10 00:49:53 2020 rev:7 rq:812820 version:3.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-bdd/python-pytest-bdd.changes      
2020-05-01 11:09:33.815352962 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-bdd.new.3606/python-pytest-bdd.changes
    2020-06-10 00:49:53.767177285 +0200
@@ -1,0 +2,6 @@
+Tue Jun  9 08:10:20 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Update to 3.4.0:
+  * Parse multiline steps according to the gherkin specification #365.
+
+-------------------------------------------------------------------

Old:
----
  pytest-bdd-3.3.0.tar.gz

New:
----
  pytest-bdd-3.4.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-bdd.spec ++++++
--- /var/tmp/diff_new_pack.ZVZ8vk/_old  2020-06-10 00:49:54.519179252 +0200
+++ /var/tmp/diff_new_pack.ZVZ8vk/_new  2020-06-10 00:49:54.523179263 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without python2
 Name:           python-pytest-bdd
-Version:        3.3.0
+Version:        3.4.0
 Release:        0
 Summary:        BDD for pytest
 License:        MIT

++++++ pytest-bdd-3.3.0.tar.gz -> pytest-bdd-3.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-bdd-3.3.0/CHANGES.rst 
new/pytest-bdd-3.4.0/CHANGES.rst
--- old/pytest-bdd-3.3.0/CHANGES.rst    2020-04-22 22:00:25.000000000 +0200
+++ new/pytest-bdd-3.4.0/CHANGES.rst    2020-06-04 17:06:05.000000000 +0200
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+3.4.0
+-----
+
+- Parse multiline steps according to the gherkin specification #365.
+
+
 3.3.0
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-bdd-3.3.0/pytest_bdd/__init__.py 
new/pytest-bdd-3.4.0/pytest_bdd/__init__.py
--- old/pytest-bdd-3.3.0/pytest_bdd/__init__.py 2020-04-22 22:00:25.000000000 
+0200
+++ new/pytest-bdd-3.4.0/pytest_bdd/__init__.py 2020-06-04 17:06:05.000000000 
+0200
@@ -3,6 +3,6 @@
 from pytest_bdd.steps import given, when, then
 from pytest_bdd.scenario import scenario, scenarios
 
-__version__ = "3.3.0"
+__version__ = "3.4.0"
 
 __all__ = [given.__name__, when.__name__, then.__name__, scenario.__name__, 
scenarios.__name__]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-bdd-3.3.0/pytest_bdd/feature.py 
new/pytest-bdd-3.4.0/pytest_bdd/feature.py
--- old/pytest-bdd-3.3.0/pytest_bdd/feature.py  2020-04-22 22:00:25.000000000 
+0200
+++ new/pytest-bdd-3.4.0/pytest_bdd/feature.py  2020-06-04 17:06:05.000000000 
+0200
@@ -545,7 +545,17 @@
     @property
     def name(self):
         """Get step name."""
-        lines = [self._name] + ([textwrap.dedent("\n".join(self.lines))] if 
self.lines else [])
+        multilines_content = textwrap.dedent("\n".join(self.lines)) if 
self.lines else ""
+
+        # Remove the multiline quotes, if present.
+        multilines_content = re.sub(
+            pattern=r'^"""\n(?P<content>.*)\n"""$',
+            repl=r"\g<content>",
+            string=multilines_content,
+            flags=re.DOTALL,  # Needed to make the "." match also new lines
+        )
+
+        lines = [self._name] + [multilines_content]
         return "\n".join(lines).strip()
 
     @name.setter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-bdd-3.3.0/tests/feature/test_multiline.py 
new/pytest-bdd-3.4.0/tests/feature/test_multiline.py
--- old/pytest-bdd-3.3.0/tests/feature/test_multiline.py        2020-04-22 
22:00:25.000000000 +0200
+++ new/pytest-bdd-3.4.0/tests/feature/test_multiline.py        2020-06-04 
17:06:05.000000000 +0200
@@ -11,66 +11,65 @@
     [
         (
             textwrap.dedent(
-                """
-        Scenario: Multiline step using sub indentation
-            Given I have a step with:
-                Some
-
-                Extra
-                Lines
-            Then the text should be parsed with correct indentation
-        """
+                '''\
+Feature: Multiline
+    Scenario: Multiline step using sub indentation
+        Given I have a step with:
+            """
+            Some
+    
+            Extra
+            Lines
+            """
+        Then the text should be parsed with correct indentation
+'''
             ),
+            "Some\n\nExtra\nLines",
+        ),
+        (
             textwrap.dedent(
-                """
-        Some
-
-        Extra
-        Lines
-        """
-            )[1:-1],
+                """\
+Feature: Multiline
+    Scenario: Multiline step using sub indentation
+        Given I have a step with:
+            Some
+    
+            Extra
+            Lines
+        Then the text should be parsed with correct indentation
+"""
+            ),
+            "Some\n\nExtra\nLines",
         ),
         (
             textwrap.dedent(
-                """
-        Scenario: Multiline step using sub indentation
-            Given I have a step with:
-                Some
+                """\
+Feature: Multiline
+    Scenario: Multiline step using sub indentation
+        Given I have a step with:
+            Some
 
-              Extra
-             Lines
+          Extra
+         Lines
 
-            Then the text should be parsed with correct indentation
-        """
+        Then the text should be parsed with correct indentation
+"""
             ),
-            textwrap.dedent(
-                """
-           Some
-
-         Extra
-        Lines
-        """
-            )[1:-1],
+            "   Some\n\n Extra\nLines",
         ),
         (
             textwrap.dedent(
-                """
-        Feature:
-        Scenario: Multiline step using sub indentation
-            Given I have a step with:
-                Some
-                Extra
-                Lines
+                """\
+Feature: Multiline
+    Scenario: Multiline step using sub indentation
+        Given I have a step with:
+            Some
+            Extra
+            Lines
 
-        """
+"""
             ),
-            textwrap.dedent(
-                """
-        Some
-        Extra
-        Lines
-        """
-            )[1:-1],
+            "Some\nExtra\nLines",
         ),
     ],
 )


Reply via email to