From: Karolina Surma Date: Tue, 19 May 2026 14:20:38 +0000 (-0400) Subject: Adjust TypeError message to Python 3.15 X-Git-Tag: rel_2_0_50~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=438f1f78492aae8577d97874d125af212d3da049;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Adjust TypeError message to Python 3.15 ### Description The `.fromisoformat()` error message tested in `test_no_string()` changed in Python 3.15, this fixes the test. See #13308 for the `rel_2_0` branch. ### Checklist This pull request is: - [ ] A documentation / typographical / small typing error fix - Good to go, no issue or tests are needed - [x] A short code fix (in a test, therefore I didn’t create an issue) - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #` in the commit message - please include tests. **Have a nice day!** Closes: #13307 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13307 Pull-request-sha: 90bc13fc416ea45ba5429d5f8ecffc24b108c1b1 Change-Id: I461d71b0fad18fa4f108102bb1c22c0e980fc70e (cherry picked from commit f07ad99839105f254df4e640ab851bcc6910168c) --- diff --git a/test/engine/test_processors.py b/test/engine/test_processors.py index 4f06f772ad..e2bb50a2c9 100644 --- a/test/engine/test_processors.py +++ b/test/engine/test_processors.py @@ -73,13 +73,13 @@ class _DateProcessorTest(fixtures.TestBase): eq_(self.module.str_to_date("2022-04-03"), datetime.date(2022, 4, 3)) - def test_date_no_string(self): - assert_raises_message( - TypeError, - "fromisoformat: argument must be str", - self.module.str_to_date, - 2012, - ) + @combinations("str_to_datetime", "str_to_time", "str_to_date") + def test_no_string(self, meth): + with expect_raises_message( + TypeError, r"fromisoformat.* argument must be str" + ): + fn = getattr(self.module, meth) + fn(2012) def test_datetime_no_string_custom_reg(self): assert_raises_message(