<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Debashisa patra</title>
    <description>The latest articles on DEV Community by Debashisa patra (@debashisa_patra_d455ab0b5).</description>
    <link>https://dev.to/debashisa_patra_d455ab0b5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3150549%2Fa71ef0e1-d9c1-4f55-8168-e028f37d3e4e.png</url>
      <title>DEV Community: Debashisa patra</title>
      <link>https://dev.to/debashisa_patra_d455ab0b5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/debashisa_patra_d455ab0b5"/>
    <language>en</language>
    <item>
      <title>Python 3.13.2 Migration - Test Mocking Compatibility Issues with Requests and Mock Library</title>
      <dc:creator>Debashisa patra</dc:creator>
      <pubDate>Sun, 11 May 2025 15:59:00 +0000</pubDate>
      <link>https://dev.to/debashisa_patra_d455ab0b5/python-3132-migration-test-mocking-compatibility-issues-with-requests-and-mock-library-30lo</link>
      <guid>https://dev.to/debashisa_patra_d455ab0b5/python-3132-migration-test-mocking-compatibility-issues-with-requests-and-mock-library-30lo</guid>
      <description>&lt;p&gt;I'm experiencing some challenges while migrating a project from Python 2.7 to Python 3.13.2, specifically with test mocking for HTTP requests.&lt;/p&gt;

&lt;p&gt;Context:&lt;br&gt;
Migrating an existing project from Python 2.7 to Python 3.13.2&lt;/p&gt;

&lt;p&gt;Using pytest for testing&lt;br&gt;
Custom test mocking utility for HTTP requests&lt;br&gt;
Specific Issue: When running tests, I'm encountering the following error across multiple test cases:&lt;br&gt;
TypeError: FakeRest.perform_request() got an unexpected keyword argument 'verify'&lt;/p&gt;

&lt;p&gt;Detailed Observations:&lt;br&gt;
In Python 2.7 (nosetests), all 27 tests passed successfully&lt;br&gt;
In Python 3.13.2 (pytest), 7 out of 27 tests are failing&lt;br&gt;
The primary error is related to an unexpected 'verify' keyword argument&lt;/p&gt;

&lt;p&gt;Questions:&lt;br&gt;
How can I modify my custom mock class to handle the 'verify' parameter in Python 3.13.2?&lt;br&gt;
Are there known differences in request mocking between Python 2.7 and Python 3.x?&lt;br&gt;
What are the best practices for updating test mocking utilities during Python version migration?&lt;/p&gt;

&lt;p&gt;Relevant Code Snippet (Simplified):&lt;/p&gt;

&lt;p&gt;class FakeRest:&lt;br&gt;
    def perform_request(self, method, *args, **kwargs):&lt;br&gt;
        # Current implementation doesn't handle 'verify' parameter&lt;br&gt;
        # Throws TypeError in Python 3.13.2&lt;/p&gt;

&lt;p&gt;Desired Outcome:&lt;br&gt;
Make the test mocking compatible with Python 3.13.2&lt;br&gt;
Maintain the existing test logic&lt;br&gt;
Ensure all tests pass&lt;/p&gt;

&lt;p&gt;Environment:&lt;br&gt;
Python 3.13.2&lt;br&gt;
pytest 8.3.5&lt;br&gt;
Custom test utilities&lt;br&gt;
Requests library&lt;/p&gt;

&lt;p&gt;Any guidance on handling this migration challenge would be greatly appreciated!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.nextwork.org/c/i-have-a-question/python-3-13-2-migration-test-mocking-compatibility-issues-with-requests-and-mock-library" rel="noopener noreferrer"&gt;https://community.nextwork.org/c/i-have-a-question/python-3-13-2-migration-test-mocking-compatibility-issues-with-requests-and-mock-library&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
