nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: symfony/ux
Pull request #2873 (2025-06-27 13:45:26)

[Tests] Fix functional tests Turbo (Chrome 137 & dev-tools)
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

Maybe I went to quick on #2867, maybe using `<server>` instead of `<env>` matters... 

**EDIT:** it seems that Turbo functional tests were broken since few weeks / months now, because of Chrome 137, see https://github.com/symfony/panther/issues/675.

Passing `PANTHER_DEVTOOLS=0` worked like a charm.


Patch:
diff --git a/src/Turbo/phpunit.xml.dist b/src/Turbo/phpunit.xml.dist
index 2fcb3efd..2ec303c5 100644
--- a/src/Turbo/phpunit.xml.dist
+++ b/src/Turbo/phpunit.xml.dist
@@ -12,8 +12,11 @@
         <ini name="error_reporting" value="-1"/>
         <env name="SHELL_VERBOSITY" value="-1"/>
         <env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
+        <env name="APP_ENV" value="test" force="true" />
+        <env name="APP_DEBUG" value="true" force="true" />
         <env name="KERNEL_CLASS" value="App\Kernel"/>
-        <env name="PANTHER_WEB_SERVER_DIR" value="./tests/app/public"/>
+        <server name="PANTHER_WEB_SERVER_DIR" value="./tests/app/public"/>
+        <server name="PANTHER_DEVTOOLS" value="0"/>
     </php>
 
     <testsuites>


Test patch:
diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml
index c4963af0..a38db2e9 100644
--- a/.github/workflows/functional-tests.yml
+++ b/.github/workflows/functional-tests.yml
@@ -56,6 +56,12 @@ jobs:
                   php-version: ${{ matrix.php-version }}
                   tools: flex
 
+            - name: Install root dependencies
+              run: composer install
+
+            - name: Build root packages
+              run: php .github/build-packages.php
+
             - name: Install dependencies with composer
               working-directory: src/Turbo
               run: |
Repository: d0c-s4vage/lookatme
Pull request #187 (2022-12-06 14:35:19)

Fixes the `--single` option with progressive slides
See #182. This PR is specifically for the 3.0-dev branch.


Patch:
diff --git a/lookatme/parser.py b/lookatme/parser.py
index db343f1..5530aff 100644
--- a/lookatme/parser.py
+++ b/lookatme/parser.py
@@ -136,14 +136,9 @@ class Parser(object):
         keep_split_token = True
 
         if self._single_slide:
+            return [Slide(tokens, 0)]
 
-            def slide_split_check(_):  # type: ignore
-                return False
-
-            def heading_mod(_):  # type: ignore
-                pass
-
-        elif num_hrules == 0:
+        if num_hrules == 0:
             if meta.get("title", "") in ["", None]:
                 meta["title"] = hinfo["title"]
 


Test patch:
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 74ed466..14848b2 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -113,6 +113,30 @@ More text
     assert len(slides) == 4
 
 
+def test_parse_slides_with_progressive_stops_and_hrule_splits_and_single_option():
+    """Test that slide parsing works correctly"""
+    input_data = r"""
+# Heading
+
+<!-- stop -->
+
+p1
+
+<!-- stop -->
+
+p2
+
+---
+
+# Slide 2
+
+More text
+    """
+    parser = Parser(single_slide=True)
+    slides = parser.parse_slides({}, input_data)
+    assert len(slides) == 1
+
+
 def test_parse_smart_slides_one_h1():
     """Test that slide smart splitting works correctly"""
     input_data = r"""
Repository: d0c-s4vage/lookatme
Pull request #194 (2022-12-12 13:36:14)

Fixes tutor tag replacement/extraction
See #193 


Patch:
diff --git a/lookatme/render/markdown_block.py b/lookatme/render/markdown_block.py
index 67e4e8e..6fba0dd 100644
--- a/lookatme/render/markdown_block.py
+++ b/lookatme/render/markdown_block.py
@@ -361,8 +361,6 @@ def render_heading_close(token: Dict, ctx: Context):
     > space chips
     </TUTOR:EXAMPLE>
 
-
-
     ## Style
 
     Block quotes can be styled with slide metadata. This is the default style:
diff --git a/lookatme/tutorial.py b/lookatme/tutorial.py
index 579b6f7..2330bbe 100644
--- a/lookatme/tutorial.py
+++ b/lookatme/tutorial.py
@@ -60,9 +60,7 @@ class Tutor:
 
         res_md = []
         last_idx = 0
-        regex = (
-            r"<(?P<tag>TUTOR:(?P<type>[A-Z_]+))(?P<attrs>.*)>(?P<inner>.*)</(?P=tag)>"
-        )
+        regex = r"<(?P<tag>TUTOR:(?P<type>[A-Z_]+))(?P<attrs>[^>]*)>(?P<inner>.*)</(?P=tag)>"
         for match in re.finditer(regex, slides_md, re.MULTILINE | re.DOTALL):
             res_md.append(slides_md[last_idx : match.start()])
             match_groups = match.groupdict()


Test patch:
diff --git a/tests/test_tutorial.py b/tests/test_tutorial.py
index 4fc289a..1710f3e 100644
--- a/tests/test_tutorial.py
+++ b/tests/test_tutorial.py
@@ -72,3 +72,20 @@ def test_tutor(mocker):
     """
     ).strip()
     assert style_yaml in md_text
+
+
+def test_tutor_with_gt_in_example():
+    tutor = tutorial.Tutor(
+        "name",
+        "group",
+        "<TUTOR:EXAMPLE>> test</TUTOR:EXAMPLE>",
+        impl_fn=lambda _: 10,
+        order=99999,
+    )
+    md_text = tutor.get_md()
+
+    md_example = "> ~~~markdown\n> > test\n> ~~~"
+    assert md_example in md_text
+
+    md_rendered = "\n> test"
+    assert md_rendered in md_text
Repository: d0c-s4vage/pfp
Pull request #9 (2015-08-20 17:02:37)

Ensure 'Strings' are properly initialized.
Strings where not utilizing the util method to
ensure py2/3 objects would be sane. This was
causing attempts at adding str and Bytes classes
which will fail.


Patch:
diff --git a/.gitignore b/.gitignore
index 4d0f85b..e90920c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ docs/build
 docs/source/generated
 *.pyc
 .*.sw*
+*~
\ No newline at end of file
diff --git a/pfp/fields.py b/pfp/fields.py
index cf4ee31..505e2f6 100644
--- a/pfp/fields.py
+++ b/pfp/fields.py
@@ -1625,7 +1625,7 @@ class String(Field):
 	terminator = utils.binary("\x00")
 
 	def __init__(self, stream=None, metadata_processor=None):
-		self._pfp__value = ""
+		self._pfp__value = utils.binary("")
 
 		super(String, self).__init__(stream=stream, metadata_processor=metadata_processor)
 
@@ -1705,7 +1705,7 @@ class String(Field):
 
 		"""
 		res_field = String()
-		res = ""
+		res = utils.binary("")
 		if isinstance(other, String):
 			res = self._pfp__value + other._pfp__value
 		else:


Test patch:
diff --git a/tests/test_strings.py b/tests/test_strings.py
index 7ebd06c..43fe8b0 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -106,5 +106,38 @@ class TestStrings(unittest.TestCase, utils.UtilsMixin):
 			stdout="Rar!\x1a\x07"
 		)
 
+	# temp_char ends up being of class Bytes in python 3 - but not on python 2
+	# This test ensures we can handle adding both a String and byte together
+	def test_add_strings(self):
+		dom = self._test_parse_build(
+			"\x01\x02\x03\x04\x05",
+			"""
+	                         local string temp_expected, temp_char;
+	                         local int i;
+	                         for(i = 0; i < 5; i++) {
+	                             SPrintf(temp_char, "%.2X", ReadUByte(FTell()+i));
+	                             temp_expected += temp_char;
+	                         }
+	                         Printf("%s", temp_expected);
+	                 """,
+			stdout="0102030405",
+			verify=False
+		)
+
+	def test_add_strings_simple(self):
+		dom = self._test_parse_build(
+			"\x01",
+			"""
+	                         local string test;
+                                 local int i;
+                                 for(i = 0; i < 5; i++) {
+                                     test += "test";
+                                 }
+                                 Printf("%s", test);
+                         """,
+			stdout="testtesttesttesttest",
+			verify=False
+		 )
+
 if __name__ == "__main__":
 	unittest.main()
Repository: SebRut/pygrocy
Pull request #31 (2019-09-18 06:04:47)

Last DB changed exposed
## Description

Will be useful for refreshing data (thinking about the custom component)

**Related issue (if applicable):** fixes #<issue number goes here>

## Checklist
  - [x] The code change is tested and works locally.
  - [x] tests pass. **Your PR won't be merged unless tests pass**
  - [x] There is no commented out code in this PR



Patch:
diff --git a/pygrocy/grocy.py b/pygrocy/grocy.py
index 6e953de..c6c6850 100644
--- a/pygrocy/grocy.py
+++ b/pygrocy/grocy.py
@@ -255,4 +255,6 @@ class Grocy(object):
     def set_userfields(self, entity: str, object_id: int, key: str, value):
         return self._api_client.set_userfields(entity, object_id, key, value)
         
+    def get_last_db_changed(self):
+        return self._api_client.get_last_db_changed()
         
\ No newline at end of file
diff --git a/pygrocy/grocy_api_client.py b/pygrocy/grocy_api_client.py
index a181945..cd37326 100644
--- a/pygrocy/grocy_api_client.py
+++ b/pygrocy/grocy_api_client.py
@@ -444,3 +444,10 @@ class GrocyApiClient(object):
         req_url = urljoin(urljoin(urljoin(self._base_url, "userfields/"), entity + "/"), str(object_id))
         resp = requests.put(req_url, verify=self._verify_ssl, headers=self._headers, data=data)
         return resp
+
+    def get_last_db_changed(self):
+        req_url = urljoin(self._base_url, "system/db-changed-time")
+        resp = requests.get(req_url, verify=self._verify_ssl, headers=self._headers)
+        last_change_timestamp = parse_date(resp.json().get('changed_time'))
+        return last_change_timestamp
+        


Test patch:
diff --git a/test/test_grocy.py b/test/test_grocy.py
index cd1d14e..cc30896 100644
--- a/test/test_grocy.py
+++ b/test/test_grocy.py
@@ -1,5 +1,6 @@
 from unittest import TestCase
 from unittest.mock import patch, mock_open
+from datetime import datetime
 import responses
 from pygrocy import Grocy
 from pygrocy.grocy import Product
@@ -411,4 +412,21 @@ class TestGrocy(TestCase):
     def test_set_userfields_error(self):
         responses.add(responses.PUT, "https://example.com/api/userfields/chores/1", status=400)
         assert self.grocy.set_userfields("chores",1,"auserfield","value").status_code != 204
-        
\ No newline at end of file
+        
+    @responses.activate
+    def test_get_last_db_changed_valid(self):
+        resp =  { "changed_time": "2019-09-18T05:30:58.598Z" }
+        
+        responses.add(responses.GET, "https://example.com/api/system/db-changed-time", json=resp, status=200)
+
+        timestamp = self.grocy.get_last_db_changed()
+
+        assert isinstance(timestamp, datetime)
+
+
+    @responses.activate
+    def test_get_last_db_changed_invalid_no_data(self):
+        resp = {}
+        responses.add(responses.GET, "https://example.com/api/system/db-changed-time", json=resp ,status=200)
+
+        assert self.grocy.get_last_db_changed() is None
Repository: SebRut/pygrocy
Pull request #227 (2022-04-07 21:35:41)

Delete generic now uses DELETE verb, instead of GET
## Description

Fixes a bug with `_do_delete_request` which was using the wrong `requests` method.

**Related issue (if applicable):** fixes #<issue number goes here>

## Checklist
  - [x] The code change is tested and works locally.
  - [x] tests pass. **Your PR won't be merged unless tests pass**
  - [x] There is no commented out code in this PR



Patch:
diff --git a/pygrocy/grocy_api_client.py b/pygrocy/grocy_api_client.py
index a3c141b..1bf3547 100644
--- a/pygrocy/grocy_api_client.py
+++ b/pygrocy/grocy_api_client.py
@@ -323,7 +323,7 @@ class GrocyApiClient(object):
 
     def _do_delete_request(self, end_url: str):
         req_url = urljoin(self._base_url, end_url)
-        resp = requests.get(req_url, verify=self._verify_ssl, headers=self._headers)
+        resp = requests.delete(req_url, verify=self._verify_ssl, headers=self._headers)
 
         _LOGGER.debug("-->\tDELETE /%s", end_url)
         _LOGGER.debug("<--\t%d for /%s", resp.status_code, end_url)


Test patch:
diff --git a/test/cassettes/test_generic/TestGeneric.test_delete_generic_error.yaml b/test/cassettes/test_generic/TestGeneric.test_delete_generic_error.yaml
index 2deba0d..bcea86f 100644
--- a/test/cassettes/test_generic/TestGeneric.test_delete_generic_error.yaml
+++ b/test/cassettes/test_generic/TestGeneric.test_delete_generic_error.yaml
@@ -10,7 +10,7 @@ interactions:
       - python-requests/2.27.1
       accept:
       - application/json
-    method: GET
+    method: DELETE
     uri: https://localhost/api/objects/tasks/30000
   response:
     body:
diff --git a/test/cassettes/test_generic/TestGeneric.test_delete_generic_success.yaml b/test/cassettes/test_generic/TestGeneric.test_delete_generic_success.yaml
index 9df6e5d..88c0ef3 100644
--- a/test/cassettes/test_generic/TestGeneric.test_delete_generic_success.yaml
+++ b/test/cassettes/test_generic/TestGeneric.test_delete_generic_success.yaml
@@ -10,7 +10,7 @@ interactions:
       - python-requests/2.27.1
       accept:
       - application/json
-    method: GET
+    method: DELETE
     uri: https://localhost/api/objects/tasks/3
   response:
     body: