{"id":298978,"date":"2020-02-20T09:00:15","date_gmt":"2020-02-20T09:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298978"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298978","title":{"rendered":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u043e\u0442\u0447\u0435\u0442 Pytest"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489108\/\">\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 html-\u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 pytest, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0448\u0451\u043b \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0445\u043e\u0447\u0443 \u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f.<br \/>  <a href=\"https:\/\/habrastorage.org\/webt\/0t\/bw\/sw\/0tbwswt3dzj57dyxnd2dupdu2ag.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0t\/bw\/sw\/0tbwswt3dzj57dyxnd2dupdu2ag.jpeg\"><\/a><br \/>  <i>* \u0412\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u044b<\/i><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/b><\/p>\n<div class=\"spoiler_text\"> * <b>python3<\/b> ( \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Linux: apt-get install python3 ) \u2014 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044f\u0437\u044b\u043a\u0430 Python<br \/>   * <b>pip3<\/b> ( \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Linux: apt-get install python3-pip ) \u2014 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f Python (\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439)<br \/>   * <b>pytest<\/b> ( \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Linux: pip3 install pytest ) \u2014 framework \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<br \/>   * <b>pytest-html<\/b> ( \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Linux: pip3 install pytest-html ) \u2014 \u043f\u043b\u0430\u0433\u0438\u043d pytest \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 html-\u043e\u0442\u0447\u0435\u0442\u043e\u0432  <\/div>\n<\/div>\n<p>  <b>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/b>:<br \/>   |- test.py ( \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 )<br \/>   |- conftest.py ( \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f hook-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 )<br \/>   |- test-1.jpg ( \u0424\u0430\u0439\u043b \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 )<br \/>   |- test-2.jpg ( \u0424\u0430\u0439\u043b \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 )<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 test.py:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import pytest import base64  # \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 log = { 'a':'none', 'b':'none', 'sum':'none' } log_html = 'none' log_img = 'none' log_img_url = 'none'  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 def set_global_var(a='none',b='none',sum_='none',html='none',img='none',img_url='none'): \tglobal log, log_html, log_img, log_img_url \tlog = { 'a': a, 'b': b, 'sum': sum_ } \tlog_html = html \tlog_img = img \tlog_img_url = img_url  # \u0424\u0438\u043a\u0441\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 @pytest.fixture(scope=&quot;function&quot;, autouse=True) def default_global_var(): \tset_global_var()  def test_default(): \t'''\u0422\u0435\u0441\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e''' \tassert True  def test_1(): \t'''\u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 2, 2 \tsum_ = a + b \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_ ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 4  def test_2(): \t'''\u0412\u0442\u043e\u0440\u043e\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 3, 3 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c html \u0431\u043b\u043e\u043a \thtml = ''' \t&lt;p&gt; \t  &lt;table border=&quot;3&quot; width=&quot;100%&quot;&gt; \t  &lt;tbody&gt; \t    &lt;tr&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;a&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;b&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;sum&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t    &lt;\/tr&gt; \t    &lt;tr&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{0}&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{1}&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{2}&lt;\/font&gt;&lt;\/td&gt; \t    &lt;\/tr&gt; \t  &lt;\/tbody&gt; \t  &lt;\/table&gt; \t  &lt;\/p&gt; \t  '''.format( a, b, sum_ ) \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, html = html ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 6  def test_3(): \t'''\u0422\u0440\u0435\u0442\u0438\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 4, 4 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 base64 \timage = open('test-1.jpg', 'rb') \timage_read = image.read() \timg = base64.encodebytes( image_read ).decode(&quot;utf-8&quot;) \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, img = img ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 8  def test_4(): \t'''\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 5, 5 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043f\u043e url \timg_url = 'test-2.jpg' \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, img_url = img_url ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 10  def test_5(): \t'''\u041f\u044f\u0442\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 5, 1 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c html \u0431\u043b\u043e\u043a \thtml = '&lt;h1&gt;\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 HTML-\u0431\u043b\u043e\u043a&lt;\/h1&gt;' \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 base64 \timage = open('test-1.jpg', 'rb') \timage_read = image.read() \timg = base64.encodebytes( image_read ).decode(&quot;utf-8&quot;) \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043f\u043e url \timg_url = 'test-2.jpg' \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, html = html, img = img, img_url = img_url ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tprint ('\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0430...') \tassert sum_ == 6  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432 @pytest.mark.parametrize(&quot;test_a, test_b, test_sum&quot;, [(1,2,3), (2,3,5), (4,5,8)]) def test_6(test_a, test_b, test_sum): \t'''\u0421\u0435\u0440\u0438\u044f \u0448\u0435\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = test_a, test_b \tsum_ = a + b \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_ ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == test_sum  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 conftest.py:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import pytest from py.xml import html  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 def pytest_html_results_table_header(cells): \tcells.insert(1, html.th('description'))\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(2, html.th('a'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 2-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(3, html.th('b'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 3-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(4, html.th('sum'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 4-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.pop()  def pytest_html_results_table_row(report, cells): \tcells.insert(1, html.td( report.description ))\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(2, html.td( report.a ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 2-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(3, html.td( report.b ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 3-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(4, html.td( report.sum ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 4-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.pop()  # hook \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432 @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): \tpytest_html = item.config.pluginmanager.getplugin('html') \toutcome = yield \treport = outcome.get_result() \t# \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 __doc__ \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \treport.description = str( item.function.__doc__ ) \treport.a = str( item.module.log['a'] ) \treport.b = str( item.module.log['b'] ) \treport.sum = str( item.module.log['sum'] ) \t# \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 html \u0438 image \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \textra = getattr(report, 'extra', []) \tif report.when == 'call': \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c html-\u0431\u043b\u043e\u043a \t\tif item.module.log_html != 'none': \t\t\textra.append(pytest_html.extras.html( item.module.log_html )) \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c img-\u0431\u043b\u043e\u043a (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u043e\u0442\u0447\u0435\u0442) \t\tif item.module.log_img != 'none': \t\t\textra.append(pytest_html.extras.image( item.module.log_img, mime_type='image\/jpg', extension='jpg' )) \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c img-\u0431\u043b\u043e\u043a \u0441 url-\u0441\u0441\u044b\u043b\u043a\u043e\u0439 \t\tif item.module.log_img_url != 'none': \t\t\textra.append(pytest_html.extras.image( item.module.log_img_url )) \t\treport.extra = extra <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <b>conftest.py<\/b><\/h1>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: <b>pytest_html_results_table_header(cells)<\/b> \u0438 <b>pytest_html_results_table_row(report, cells)<\/b>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 def pytest_html_results_table_header(cells): \tcells.insert(1, html.th('description'))\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(2, html.th('a'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 2-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(3, html.th('b'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 3-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.insert(4, html.th('sum'))\t\t\t# \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 4-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \tcells.pop()  def pytest_html_results_table_row(report, cells): \tcells.insert(1, html.td( report.description ))\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(2, html.td( report.a ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 2-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(3, html.td( report.b ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 3-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.insert(4, html.td( report.sum ))\t\t# \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 4-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \tcells.pop() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<ul>\n<li><b>cells.insert( <i>_number<\/i>, html.th( <i>_name<\/i> ))<\/b> \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u0434 <i>_number<\/i> \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c <i>_name<\/i><\/li>\n<\/ul>\n<p>  \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0442\u0435\u0441\u0442\u0443, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, hook: <b>def pytest_runtest_makereport(item, call)<\/b> \u0441 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u043c: <b>@pytest.hookimpl(hookwrapper=True)<\/b>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># hook \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432 @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, call): \tpytest_html = item.config.pluginmanager.getplugin('html') \toutcome = yield \treport = outcome.get_result() \t# \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 __doc__ \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \treport.description = str( item.function.__doc__ ) \treport.a = str( item.module.log['a'] ) \treport.b = str( item.module.log['b'] ) \treport.sum = str( item.module.log['sum'] ) \t# \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 html \u0438 image \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \textra = getattr(report, 'extra', []) \tif report.when == 'call': \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c html-\u0431\u043b\u043e\u043a \t\tif item.module.log_html != 'none': \t\t\textra.append(pytest_html.extras.html( item.module.log_html )) \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c img-\u0431\u043b\u043e\u043a (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u043e\u0442\u0447\u0435\u0442) \t\tif item.module.log_img != 'none': \t\t\textra.append(pytest_html.extras.image( item.module.log_img, mime_type='image\/jpg', extension='jpg' )) \t\t# \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c img-\u0431\u043b\u043e\u043a \u0441 url-\u0441\u0441\u044b\u043b\u043a\u043e\u0439 \t\tif item.module.log_img_url != 'none': \t\t\textra.append(pytest_html.extras.image( item.module.log_img_url )) \t\treport.extra = extra <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422.\u0435. \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b>pytest_runtest_makereport(item, call)<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c:  <\/p>\n<ul>\n<li><b>report.description = str( item.function.__doc__ )<\/b> \u2014 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 report.description \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 __doc__ \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/li>\n<li><b>report.a = str( item.module.log[&#8216;a&#8217;] )<\/b> \u2014 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 report.a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log[&#8216;a&#8217;];<\/li>\n<li><b>report.b = str( item.module.log[&#8216;b&#8217;] )<\/b> \u2014 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 report.b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log[&#8216;b&#8217;];<\/li>\n<li><b>report.sum = str( item.module.log[&#8216;sum&#8217;] )<\/b> \u2014 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 report.sum \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log[&#8216;sum&#8217;];<\/li>\n<li><b>extra.append(pytest_html.extras.html( item.module.log_html ))<\/b> \u2014 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0442\u0435\u0441\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d html-\u0431\u043b\u043e\u043a, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u043e \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log_html;<\/li>\n<li><b>extra.append(pytest_html.extras.image( item.module.log_img, mime_type=&#8217;image\/jpg&#8217;, extension=&#8217;jpg&#8217; ))<\/b> \u2014 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0442\u0435\u0441\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d img-\u0431\u043b\u043e\u043a, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u043e \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log_img;<\/li>\n<li><b>extra.append(pytest_html.extras.image( item.module.log_img_url ))<\/b> \u2014 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0442\u0435\u0441\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d img-\u0431\u043b\u043e\u043a, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u043e \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 log_img_url.<\/li>\n<\/ul>\n<p>  <\/p>\n<h1>\u0421\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <b>test.py<\/b>.<\/h1>\n<p>  \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u043e\u0442\u0447\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 __doc__, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 log = { 'a':'none', 'b':'none', 'sum':'none' } log_html = 'none' log_img = 'none' log_img_url = 'none' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 def set_global_var(a='none',b='none',sum_='none',html='none',img='none',img_url='none'): \tglobal log, log_html, log_img, log_img_url \tlog = { 'a': a, 'b': b, 'sum': sum_ } \tlog_html = html \tlog_img = img \tlog_img_url = img_url <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e \u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u0441\u0442\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">@pytest.fixture(scope=&quot;function&quot;, autouse=True) def default_global_var(): \tset_global_var() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code class=\"bash\">pytest test.py -v --html=report.html --self-contained-html<\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b <b>report.html<\/b>.  <\/p>\n<h1>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432:<\/h1>\n<p>  <\/p>\n<ol>\n<li><b>test_default()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_default(): \t'''\u0422\u0435\u0441\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e''' \tassert True <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/fk\/2y\/fc\/fk2yfc1ogpa9fidbwhlqxkrbbty.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fk\/2y\/fc\/fk2yfc1ogpa9fidbwhlqxkrbbty.jpeg\"><\/a><br \/>  <cut><\/cut>  <\/li>\n<li><b>test_1()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_1(): \t'''\u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 2, 2 \tsum_ = a + b \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_ ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 4 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/to\/8v\/hz\/to8vhzgtpihywrjx30wyvpeqnam.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/to\/8v\/hz\/to8vhzgtpihywrjx30wyvpeqnam.jpeg\"><\/a>  <\/li>\n<li><b>test_2()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f html-\u0431\u043b\u043e\u043a\u0430) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_2(): \t'''\u0412\u0442\u043e\u0440\u043e\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 3, 3 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c html \u0431\u043b\u043e\u043a \thtml = ''' \t&lt;p&gt; \t  &lt;table border=&quot;3&quot; width=&quot;100%&quot;&gt; \t  &lt;tbody&gt; \t    &lt;tr&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;a&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;b&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td bgcolor=&quot;#D3D3D3&quot;&gt;&lt;font color=&quot;black&quot;&gt;&lt;strong&gt;sum&lt;\/strong&gt;&lt;\/font&gt;&lt;\/td&gt; \t    &lt;\/tr&gt; \t    &lt;tr&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{0}&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{1}&lt;\/font&gt;&lt;\/td&gt; \t      &lt;td&gt;&lt;font color=&quot;black&quot;&gt;{2}&lt;\/font&gt;&lt;\/td&gt; \t    &lt;\/tr&gt; \t  &lt;\/tbody&gt; \t  &lt;\/table&gt; \t  &lt;\/p&gt; \t  '''.format( a, b, sum_ ) \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, html = html ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 6 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/ur\/k3\/ct\/urk3ctm1aikenmelyqfdpvfonxa.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ur\/k3\/ct\/urk3ctm1aikenmelyqfdpvfonxa.jpeg\"><\/a>  <\/li>\n<li><b>test_3()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f img-\u0431\u043b\u043e\u043a\u0430) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_3(): \t'''\u0422\u0440\u0435\u0442\u0438\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 4, 4 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 base64 \timage = open('test-1.jpg', 'rb') \timage_read = image.read() \timg = base64.encodebytes( image_read ).decode(&quot;utf-8&quot;) \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, img = img ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 8 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/jj\/kx\/rl\/jjkxrlglkaclo8m4jb3y04qmeno.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jj\/kx\/rl\/jjkxrlglkaclo8m4jb3y04qmeno.jpeg\"><\/a><br \/>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b4\/h5\/1w\/b4h51wdkqxpex9vbx35fsmhhyma.jpeg\">  <\/li>\n<li><b>test_4()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f img-\u0431\u043b\u043e\u043a\u0430) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_4(): \t'''\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 5, 5 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043f\u043e url \timg_url = 'test-2.jpg' \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, img_url = img_url ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == 10 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/ck\/jl\/kv\/ckjlkvdnzrz_idgmduuze2g9ujq.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ck\/jl\/kv\/ckjlkvdnzrz_idgmduuze2g9ujq.jpeg\"><\/a><br \/>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0447\u0435\u0440\u0435\u0437 \u0433\u0438\u043f\u0435\u0440\u0441\u0441\u044b\u043b\u043a\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5n\/t6\/pp\/5nt6ppdhrnfho7v3p01jf4fxvpk.jpeg\">  <\/li>\n<li><b>test_5()<\/b><br \/>  \u0422\u0435\u0441\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f html-\u0431\u043b\u043e\u043a\u0430, img-\u0431\u043b\u043e\u043a\u0430) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">def test_5(): \t'''\u041f\u044f\u0442\u044b\u0439 \u0442\u0435\u0441\u0442''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = 5, 1 \tsum_ = a + b \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c html \u0431\u043b\u043e\u043a \thtml = '&lt;h1&gt;\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 HTML-\u0431\u043b\u043e\u043a&lt;\/h1&gt;' \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 base64 \timage = open('test-1.jpg', 'rb') \timage_read = image.read() \timg = base64.encodebytes( image_read ).decode(&quot;utf-8&quot;) \t# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043f\u043e url \timg_url = 'test-2.jpg' \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_, html = html, img = img, img_url = img_url ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tprint ('\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0430...') \tassert sum_ == 6 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/gn\/aw\/bl\/gnawblhudf8dvuo-ijwwpsdyp0o.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gn\/aw\/bl\/gnawblhudf8dvuo-ijwwpsdyp0o.jpeg\"><\/a>  <\/li>\n<li><b>test_6()<\/b><br \/>  \u0421\u0435\u0440\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\"># \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432  <\/p>\n<pre><code class=\"python\">@pytest.mark.parametrize(&quot;test_a, test_b, test_sum&quot;, [(1,2,3), (2,3,5), (4,5,8)]) def test_6(test_a, test_b, test_sum): \t'''\u0421\u0435\u0440\u0438\u044f \u0448\u0435\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430''' \t# \u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0443\u043c\u043c\u044b \ta, b = test_a, test_b \tsum_ = a + b \t# \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \tset_global_var( a = a, b = b, sum_ = sum_ ) \t# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \tassert sum_ == test_sum <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a href=\"https:\/\/habrastorage.org\/webt\/in\/-m\/07\/in-m07yyrgevraqgp05swarfeem.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/in\/-m\/07\/in-m07yyrgevraqgp05swarfeem.jpeg\"><\/a>  <\/li>\n<\/ol>\n<h1>P.S.:<\/h1>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u043e\u0442\u0447\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e. \u041d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0431\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b.<br \/>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0412\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0447\u0435\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"https:\/\/habrastorage.org\/webt\/fu\/zn\/p7\/fuznp7xit3sjvmsudcvrg6ptx5g.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fu\/zn\/p7\/fuznp7xit3sjvmsudcvrg6ptx5g.jpeg\"><\/a>  <\/div>\n<\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/489108\/\"> https:\/\/habr.com\/ru\/post\/489108\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489108\/\">\u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 html-\u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 pytest, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0448\u0451\u043b \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0445\u043e\u0447\u0443 \u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f.<br \/>  <a href=\"https:\/\/habrastorage.org\/webt\/0t\/bw\/sw\/0tbwswt3dzj57dyxnd2dupdu2ag.jpeg\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0t\/bw\/sw\/0tbwswt3dzj57dyxnd2dupdu2ag.jpeg\"><\/a><br \/>  <i>* \u0412\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u044b<\/i>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-298978","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298978"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298978\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}