{"id":30225,"date":"2024-01-01T20:51:50","date_gmt":"2024-01-01T15:21:50","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=30225"},"modified":"2024-01-01T20:52:12","modified_gmt":"2024-01-01T15:22:12","slug":"pytest-assert-function-called","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/","title":{"rendered":"Master Pytest Assert Function called"},"content":{"rendered":"\n<p>The pytest is a common framework used for testing scripts. It has a wide variety of assert functions. pytest <strong>assert function called<\/strong> has several related attributes that have been discussed in this blog. Read to know more!<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Why_are_we_required_to_assert_functions\" >Why are we required to assert functions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Benefits_of_Mock_modules_assertions\" >Benefits of Mock module&#8217;s assertions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Types_of_Mock_modules_assertions\" >Types of Mock module&#8217;s assertions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Working_of_assert_functions\" >Working of assert functions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Using_assert_called\" >Using assert_called()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Using_assert_called_once\" >Using assert_called_once()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Using_assert_called_with\" >Using assert_called_with()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Using_assert_not_called\" >Using assert_not_called()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Using_assert_has_calls\" >Using assert_has_calls()<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#pytest_assert_function_called_n_times\" >pytest assert function called n times<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Pytest_assert_function_called_without_mock\" >Pytest assert function called without mock<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Other_tips_while_working_with_assert_functions\" >Other tips while working with assert functions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#FAQs\" >FAQs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#Trending_Articles\" >Trending Articles<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-why-are-we-required-to-assert-functions\"><span class=\"ez-toc-section\" id=\"Why_are_we_required_to_assert_functions\"><\/span>Why are we required to assert functions?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The mock module helps in checking the function calls. Assume you have made a script to assess whether your function works properly or not. The mock module consists of plenty of assertions that are responsible for the verification part. They will tell you whether your script is actually working or not.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-benefits-of-mock-module-s-assertions\"><span class=\"ez-toc-section\" id=\"Benefits_of_Mock_modules_assertions\"><\/span>Benefits of Mock module&#8217;s assertions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The mock module holds great importance in the code-testing phase. Let us see in which ways it proves to be of great use to developers. The assert functions hold the following benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Improved code quality<\/strong><\/li>\n\n\n\n<li><strong>Early error detection<\/strong><\/li>\n\n\n\n<li><strong>Enhanced code readability<\/strong><\/li>\n\n\n\n<li><strong>Simplified testing<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-types-of-mock-module-s-assertions\"><span class=\"ez-toc-section\" id=\"Types_of_Mock_modules_assertions\"><\/span>Types of Mock module&#8217;s assertions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This module under the pytest <a href=\"https:\/\/en.wikipedia.org\/wiki\/Software_framework\" target=\"_blank\" rel=\"noreferrer noopener\">framework<\/a> provides a great number of assertions. These assertions can be used with a mock object. Such objects are representative of real-time functions and are used for testing purposes. These assertions are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>assert_called()<\/code>&nbsp;&#8211; function call at least once.<\/li>\n\n\n\n<li><code>assert_called_once()<\/code>&nbsp;&#8211; function call exactly once.<\/li>\n\n\n\n<li><code>assert_called_with()<\/code>&nbsp;&#8211; function call with specific arguments.<\/li>\n\n\n\n<li><code>assert_has_calls()<\/code>\u00a0&#8211;  if the function call has specific arguments.<\/li>\n\n\n\n<li><code>assert_not_called()<\/code>&nbsp;&#8211; if a function has not been called at all.<\/li>\n<\/ul>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-golf monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\">[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-working-of-assert-functions\"><span class=\"ez-toc-section\" id=\"Working_of_assert_functions\"><\/span>Working of assert functions <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The following sections elaborate on the functioning of all these assert functions, namely: <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-assert-called\"><span class=\"ez-toc-section\" id=\"Using_assert_called\"><\/span>Using assert_called()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This function will let you know whether it has been called at least once. If there is no response, it means that you need to make changes to your original script. It uses a decorator to function because you can make changes to the function once, as decorators don&#8217;t modify the entire code but just the function part that you will make a call to.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport unittest\nfrom unittest.mock import patch\n\ndef my_function(x, y):\n    return x + y\n\nclass MyTest(unittest.TestCase):\n\n    @patch('my_module.my_function')\n    def test_my_function(self, mock_my_function):\n        my_function(1, 2)\n        my_function(3, 4)\n\n        mock_my_function.assert_called()\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-assert-called-once\"><span class=\"ez-toc-section\" id=\"Using_assert_called_once\"><\/span>Using assert_called_once()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This function lets you check whether you have called the function exactly one time or not. Once this has been ensured, we can be clear of the fact that the <a href=\"http:\/\/www.pythonpool.com\/assertequal-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">mock <\/a>object works one time. In other words, it has been asserted once only. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport unittest\nfrom unittest.mock import patch\n\ndef my_function(x, y):\n    return x + y\n\nclass MyTest(unittest.TestCase):\n\n    @patch('my_module.my_function')\n    def test_my_function(self, mock_my_function):\n        my_function(1, 2)\n\n        mock_my_function.assert_called_once()\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-assert-called-with\"><span class=\"ez-toc-section\" id=\"Using_assert_called_with\"><\/span>Using assert_called_with()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this type of assert function call, the user can specify mock arguments as per his choice. In the example given below, <code>my_function()<\/code> the function has the arguments 1 and 2. Once this is successful, it means that the mock object has been asserted correctly. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport unittest\nfrom unittest.mock import patch\n\ndef my_function(x, y):\n    return x + y\n\nclass MyTest(unittest.TestCase):\n\n    @patch('my_module.my_function')\n    def test_my_function(self, mock_my_function):\n        my_function(1, 2)\n\n        mock_my_function.assert_called_with(1, 2)\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-assert-not-called\"><span class=\"ez-toc-section\" id=\"Using_assert_not_called\"><\/span>Using assert_not_called()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this function type, the test case makes no function call. We have the pass keyword instead. Thus, if this executes correctly, assert_not_called() confirms that the code has no issues else you need to check the code again.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport unittest\nfrom unittest.mock import patch\n\ndef my_function(x, y):\n    return x + y\n\nclass MyTest(unittest.TestCase):\n\n    @patch('my_module.my_function')\n    def test_my_function(self, mock_my_function):\n        pass\n\n        mock_my_function.assert_not_called()\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-assert-has-calls\"><span class=\"ez-toc-section\" id=\"Using_assert_has_calls\"><\/span>Using <code>assert_has_calls()<\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The <code>assert_has_calls()<\/code> function creates a mock object with arguments specified by the developer to see if the function asserts anything or not. The mock object for this function includes <code class=\"\">5<\/code> and <code class=\"\">3<\/code> as the arguments.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport unittest\nfrom unittest.mock import patch\n\ndef add_numbers(x, y):\n    return x + y\n\nclass MyTest(unittest.TestCase):\n    @patch('my_module.add_numbers')\n    def test_add_numbers(self, mock_add_numbers):\n        result = add_numbers(5, 3)\n\n        mock_add_numbers.assert_has_calls(&#x5B;\n            mock.call(5, 3),\n        ])\n<\/pre><\/div>\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background\"><strong>Recommend Reading | <a href=\"http:\/\/www.pythonpool.com\/python-unittest-vs-pytest\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"text-decoration: underline;\">Python Unittest Vs Pytest: Choose the Best<\/span><\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-pytest-assert-function-called-n-times\"><span class=\"ez-toc-section\" id=\"pytest_assert_function_called_n_times\"><\/span>pytest assert function called n times<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In pytest, you can check the number of times you have made a function call. This can be done through the <code>call_count<\/code> attribute of the mock object. You can verify how many times the function call has been made. The example given below explains this. You need to use the <code class=\"\">patch<\/code>&nbsp;function of the&nbsp;<code class=\"\">unittest.mock<\/code>&nbsp;module to carry out this operation. The decorator replaces the real function with the mock function.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom unittest.mock import patch\n\n@patch('my_module.my_function')\ndef test_my_function(self, mock_function):\n    # Call the function under test\n    my_function(1, 2)\n    my_function(3, 4)\n\n    # Assert that the function was called twice\n    assert mock_function.call_count == 2\n<\/pre><\/div>\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-beta monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-image\"><a href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined.webp 1200w \" alt=\"[Fixed] nameerror: name Unicode is not defined\" \/><\/a><\/div><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Trending<\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\">[Fixed] nameerror: name Unicode is not defined<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-pytest-assert-function-called-without-mock\"><span class=\"ez-toc-section\" id=\"Pytest_assert_function_called_without_mock\"><\/span>Pytest assert function called without mock<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can try calling the assert function without creating a mock object. This works when you are working with the pytest-mock plugin. Consider the example given below. It uses a <strong><code>mocker<\/code> fixture<\/strong> instead of a mock directly. The mocker fixture lets you access a mock object for any function\u00a0or class. It then uses the <code>assert_called_once<\/code> method to check whether the function call is made once or not. You can specify the arguments you want in the\u00a0placeholder (<code class=\"\">...<\/code>). The\u00a0<code class=\"\">mocker<\/code>\u00a0fixture lets you create a mock object for the required function. You can be a bit more specific with the module.function by specifying the actual path to the mocked function.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pytest\n\n@pytest.mark.parametrize(...)\ndef test_function_called(mocker):\n  mock_function = mocker.patch('module.function')\n  # Code that calls the function\n  assert mock_function.called_once()\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-other-tips-while-working-with-assert-functions\"><span class=\"ez-toc-section\" id=\"Other_tips_while_working_with_assert_functions\"><\/span><div>Other tips while working with assert functions<\/div><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You need to keep certain tips in mind while working with assert functions of the pytest module. These are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Don&#8217;t load your code with assert functions. This will make it unreadable. <\/li>\n\n\n\n<li>The function can use decorators to be simple and clear.<\/li>\n\n\n\n<li>Try working on assert functions with mock objects.<\/li>\n\n\n\n<li>See which assert function works the best as per your use case. <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-faqs\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1700760844487\"><strong class=\"schema-faq-question\">Should I use assert functions to\u00a0control program flow?<\/strong> <p class=\"schema-faq-answer\">No, you should use these functions for code testing. <\/p> <\/div> <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This article elaborates on the pytest assert function and other functions in the mock module under the pytest framework. It explains some commonly used assert functions that are efficient in code testing. <\/p>\n\n\n<div class=\"monsterinsights-widget-popular-posts monsterinsights-widget-popular-posts-delta monsterinsights-popular-posts-styled monsterinsights-widget-popular-posts-columns-2\"><h2 class=\"monsterinsights-widget-popular-posts-widget-title\"><span class=\"ez-toc-section\" id=\"Trending_Articles\"><\/span>Trending Articles<span class=\"ez-toc-section-end\"><\/span><\/h2><ul class=\"monsterinsights-widget-popular-posts-list\"><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_.webp 1200w \" alt=\"[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 11, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined.webp 1200w \" alt=\"[Fixed] nameerror: name Unicode is not defined\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] nameerror: name Unicode is not defined<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/solved-runtimeerror-cuda-error-invalid-device-ordinal\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal.webp 1200w \" alt=\"[Solved] runtimeerror: cuda error: invalid device ordinal\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Solved] runtimeerror: cuda error: invalid device ordinal<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-type-numpy-ndarray-doesnt-define-__round__-method\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method.webp 1200w \" alt=\"[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><\/ul><\/div><p><\/p>","protected":false},"excerpt":{"rendered":"<p>The pytest is a common framework used for testing scripts. It has a wide variety of assert functions. pytest assert function called has several related &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Master Pytest Assert Function called\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#more-30225\" aria-label=\"More on Master Pytest Assert Function called\">Read more<\/a><\/p>\n","protected":false},"author":38,"featured_media":31702,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-30225","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Master Pytest Assert Function called - Python Pool<\/title>\n<meta name=\"description\" content=\"Master and learn pytest&#039;s assert function called: A concise guide for validating function calls in your Python tests.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Master Pytest Assert Function called\" \/>\n<meta property=\"og:description\" content=\"The pytest is a common framework used for testing scripts. It has a wide variety of assert functions. pytest assert function called has several related\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-01T15:21:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T15:22:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Namrata Gulati\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Namrata Gulati\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\"},\"author\":{\"name\":\"Namrata Gulati\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6\"},\"headline\":\"Master Pytest Assert Function called\",\"datePublished\":\"2024-01-01T15:21:50+00:00\",\"dateModified\":\"2024-01-01T15:22:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\"},\"wordCount\":805,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\",\"url\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\",\"name\":\"Master Pytest Assert Function called - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp\",\"datePublished\":\"2024-01-01T15:21:50+00:00\",\"dateModified\":\"2024-01-01T15:22:12+00:00\",\"description\":\"Master and learn pytest's assert function called: A concise guide for validating function calls in your Python tests.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp\",\"width\":1200,\"height\":628,\"caption\":\"pytest assert function called\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Master Pytest Assert Function called\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6\",\"name\":\"Namrata Gulati\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g\",\"caption\":\"Namrata Gulati\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487\",\"position\":1,\"url\":\"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487\",\"name\":\"Should I use assert functions to\u00a0control program flow?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No, you should use these functions for code testing. \",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Master Pytest Assert Function called - Python Pool","description":"Master and learn pytest's assert function called: A concise guide for validating function calls in your Python tests.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/","og_locale":"en_US","og_type":"article","og_title":"Master Pytest Assert Function called","og_description":"The pytest is a common framework used for testing scripts. It has a wide variety of assert functions. pytest assert function called has several related","og_url":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/","og_site_name":"Python Pool","article_published_time":"2024-01-01T15:21:50+00:00","article_modified_time":"2024-01-01T15:22:12+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp","type":"image\/webp"}],"author":"Namrata Gulati","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Namrata Gulati","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/"},"author":{"name":"Namrata Gulati","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6"},"headline":"Master Pytest Assert Function called","datePublished":"2024-01-01T15:21:50+00:00","dateModified":"2024-01-01T15:22:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/"},"wordCount":805,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/","url":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/","name":"Master Pytest Assert Function called - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp","datePublished":"2024-01-01T15:21:50+00:00","dateModified":"2024-01-01T15:22:12+00:00","description":"Master and learn pytest's assert function called: A concise guide for validating function calls in your Python tests.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/pytest-assert-function-called\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/pytest-assert-function-called.webp","width":1200,"height":628,"caption":"pytest assert function called"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Master Pytest Assert Function called"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6","name":"Namrata Gulati","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g","caption":"Namrata Gulati"}},{"@type":"Question","@id":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487","position":1,"url":"https:\/\/www.pythonpool.com\/pytest-assert-function-called\/#faq-question-1700760844487","name":"Should I use assert functions to\u00a0control program flow?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"No, you should use these functions for code testing. ","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/30225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=30225"}],"version-history":[{"count":82,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/30225\/revisions"}],"predecessor-version":[{"id":31708,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/30225\/revisions\/31708"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/31702"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=30225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=30225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=30225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}