{"id":322399,"date":"2021-04-30T15:00:26","date_gmt":"2021-04-30T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322399"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322399","title":{"rendered":"\u0420\u0435\u0436\u0438\u043c \u043c\u0430\u0447\u0435\u0442\u0435: \u0442\u0435\u0433\u0438 \u0434\u043b\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430<a href=\"https:\/\/otus.pw\/3A4o\/\"> &#171;<strong>Python Developer. Professional<\/strong>&#171;.<\/a><\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u0435\u043c\u043e-\u0443\u0440\u043e\u043a<a href=\"https:\/\/otus.pw\/fIEN\/\"> <strong>\u00ab\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Python 3.10\u00bb.<\/strong> <\/a>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 PEP\u044b \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0440\u0435\u043b\u0438\u0437 Python 3.10. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438.  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d33\/49d\/0d3\/d3349d0d36ada0db5e1f332e0cbc4b35.png\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0430\u0434\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Python, \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u043e\u0439 <a href=\"https:\/\/nedbatchelder.com\/text\/machete.html\">\u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u0430\u0447\u0435\u0442\u0435<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d, \u0442\u043e \u043f\u043e\u044f\u0441\u043d\u044e, \u0440\u0435\u0436\u0438\u043c \u00ab\u043c\u0430\u0447\u0435\u0442\u0435\u00bb \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0433\u0440\u0443\u0431\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.&nbsp;<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e. \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 <em>coverage.py<\/em>. \u0420\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0435\u0433\u043e \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/340\/fcf\/e9d\/340fcfe9d5df8dc80c5db8eb21d176b5.png\" width=\"1274\" height=\"540\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u0436, \u0441\u0442\u0440\u0430\u043d\u043d\u043e: \u0434\u0432\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0435\u0449\u0435 \u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430 \u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f. \u042f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437 <code>unittest.TestCase<\/code>, \u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u00ab\u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043e\u043a\u00bb \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u0442\u043e\u043a\u0430 \u043a\u043e\u0434\u0430. \u0414\u0443\u043c\u0430\u044f \u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u043c\u043e\u0438 \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043a\u0438 \u0431\u044b\u043b\u0438 \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a\u0438\u043c\u0438, \u043b\u0438\u0431\u043e \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043a\u0440\u0430\u0435\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a pytest \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430? \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<pre><code class=\"python\">def setup_test(self):     import inspect     project_home = \"\/Users\/ned\/coverage\"     site_packages = \".tox\/py39\/lib\/python3.9\/site-packages\/\"     with open(\"\/tmp\/foo.txt\", \"a\") as foo:         print(\"setup_test\", file=foo)         for t in inspect.stack()[::-1]:             # t is (frame, filename, lineno, function, code_context, index)             frame, filename, lineno, function = t[:4]             filename = os.path.relpath(filename, project_home)             filename = filename.replace(site_packages, \"\")             show = \"%30s : %s:%d\" % (function, filename, lineno)             print(show, file=foo)<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043c\u043e\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0430\u0434\u0440\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u044f \u043f\u0438\u0448\u0443 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u041f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0434\u0435\u043b\u0430\u044e \u0438\u0445 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u0438 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u044e\u0441\u044c \u043e\u0442 \u043f\u0443\u0442\u0435\u0439 \u043a \u043f\u0430\u043a\u0435\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430, \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0435\u043a\u0430, \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438:<\/p>\n<pre><code class=\"python\">setup_test                       &lt;module&gt; : igor.py:424                           main : igor.py:416            do_test_with_tracer : igor.py:216                      run_tests : igor.py:133                           main : _pytest\/config\/__init__.py:84                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187            pytest_cmdline_main : _pytest\/main.py:243                   wrap_session : _pytest\/main.py:206                          _main : _pytest\/main.py:250                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187             pytest_runtestloop : _pytest\/main.py:271                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187        pytest_runtest_protocol : flaky\/flaky_pytest_plugin.py:94        pytest_runtest_protocol : _pytest\/runner.py:78                runtestprotocol : _pytest\/runner.py:87                call_and_report : flaky\/flaky_pytest_plugin.py:138              call_runtest_hook : _pytest\/runner.py:197                      from_call : _pytest\/runner.py:226                       &lt;lambda&gt; : _pytest\/runner.py:198                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187           pytest_runtest_setup : _pytest\/runner.py:116                        prepare : _pytest\/runner.py:362                          setup : _pytest\/python.py:1468                   fillfixtures : _pytest\/fixtures.py:296                  _fillfixtures : _pytest\/fixtures.py:469                getfixturevalue : _pytest\/fixtures.py:479         _get_active_fixturedef : _pytest\/fixtures.py:502         _compute_fixture_value : _pytest\/fixtures.py:587                        execute : _pytest\/fixtures.py:894                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187           pytest_fixture_setup : _pytest\/fixtures.py:936              call_fixture_func : _pytest\/fixtures.py:795              connect_to_pytest : tests\/mixins.py:33                     setup_test : tests\/test_process.py:1651<\/code><\/pre>\n<p>\u042f \u043d\u0430\u0434\u0435\u044f\u043b\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0434\u0430\u0441\u0442 \u043c\u043d\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0432\u0441\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e, \u0442\u043e \u0434\u0435\u043b\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0430\u0445. \u041d\u043e \u043a\u0430\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0445 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430?<\/p>\n<p>\u0411\u0443\u0434\u044c \u044f \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043a\u043e\u0434\u043e\u043c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u043e\u0434\u043d\u0430 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u0441\u0442\u043e. \u041d\u043e pytest \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439, \u0438 \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043c. \u0423 \u043c\u0435\u043d\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 pytest, \u0442\u0430\u043a \u0447\u0442\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u0434\u0435\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0435.<\/p>\n<p>\u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0435\u043a\u0430 \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432: \u043a\u0442\u043e \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0438 \u043e\u0442\u043a\u0443\u0434\u0430. \u041d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u0435\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0421\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043a\u0430\u0434\u0440 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 (\u043e\u0434\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b), \u0430 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u043a\u0430\u0434\u0440 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f (\u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430). \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043a\u0430\u0434\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0435\u043a\u0430 \u043a \u0441\u0442\u0435\u043a\u0443, \u0442\u043e \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u0446\u0438\u043a\u043b \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u0431\u044b\u043b\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c id \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0444\u0440\u0435\u0439\u043c\u0430, \u043d\u043e id \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0438\u043c \u0442\u0435\u0433\u0438? \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u043c \u043a \u0444\u0440\u0435\u0439\u043c\u0443.&nbsp; \u0412 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 \u044f \u043f\u0438\u0448\u0443 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u0430\u0434\u0440.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0446\u0438\u043a\u043b \u043f\u043e \u043a\u0430\u0434\u0440\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430. \u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u0442, \u0442\u043e \u043e\u043d\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u0430 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0441\u0442\u0435\u043a\u0430, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/p>\n<pre><code class=\"python\">def setup_test(self):     import inspect     project_home = \"\/Users\/ned\/coverage\"     site_packages = \".tox\/py39\/lib\/python3.9\/site-packages\/\"     with open(\"\/tmp\/foo.txt\", \"a\") as foo:         print(\"setup_test\", file=foo)         for t in inspect.stack()[::-1]:             # t is (frame, filename, lineno, function, code_context, index)             frame, filename, lineno, function = t[:4]             visits = frame.f_locals.get(\"$visits\", 0)       ## new             frame.f_locals[\"$visits\"] = visits + 1          ## new             filename = os.path.relpath(filename, project_home)             filename = filename.replace(site_packages, \"\")             show = \"%30s :  %d  %s:%d\" % (function, visits, filename, lineno)             print(show, file=foo)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0435\u043a\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435, \u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0412\u043e\u0442 \u0441\u0442\u0435\u043a \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\">setup_test                       &lt;module&gt; :  1  igor.py:424                           main :  1  igor.py:416            do_test_with_tracer :  1  igor.py:216                      run_tests :  1  igor.py:133                           main :  1  _pytest\/config\/__init__.py:84                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187            pytest_cmdline_main :  1  _pytest\/main.py:243                   wrap_session :  1  _pytest\/main.py:206                          _main :  1  _pytest\/main.py:250                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187             pytest_runtestloop :  1  _pytest\/main.py:271                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187        pytest_runtest_protocol :  1  flaky\/flaky_pytest_plugin.py:94        pytest_runtest_protocol :  0  _pytest\/runner.py:78                runtestprotocol :  0  _pytest\/runner.py:87                call_and_report :  0  flaky\/flaky_pytest_plugin.py:138              call_runtest_hook :  0  _pytest\/runner.py:197                      from_call :  0  _pytest\/runner.py:226                       &lt;lambda&gt; :  0  _pytest\/runner.py:198                       __call__ :  0  pluggy\/hooks.py:286                      _hookexec :  0  pluggy\/manager.py:93                       &lt;lambda&gt; :  0  pluggy\/manager.py:84                     _multicall :  0  pluggy\/callers.py:187           pytest_runtest_setup :  0  _pytest\/runner.py:116                        prepare :  0  _pytest\/runner.py:362                          setup :  0  _pytest\/python.py:1468                   fillfixtures :  0  _pytest\/fixtures.py:296                  _fillfixtures :  0  _pytest\/fixtures.py:469                getfixturevalue :  0  _pytest\/fixtures.py:479         _get_active_fixturedef :  0  _pytest\/fixtures.py:502         _compute_fixture_value :  0  _pytest\/fixtures.py:587                        execute :  0  _pytest\/fixtures.py:894                       __call__ :  0  pluggy\/hooks.py:286                      _hookexec :  0  pluggy\/manager.py:93                       &lt;lambda&gt; :  0  pluggy\/manager.py:84                     _multicall :  0  pluggy\/callers.py:187           pytest_fixture_setup :  0  _pytest\/fixtures.py:936              call_fixture_func :  0  _pytest\/fixtures.py:795              connect_to_pytest :  0  tests\/mixins.py:33                     setup_test :  0  tests\/test_process.py:1651<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0438\u0446\u044b \u2013 \u044d\u0442\u043e \u043a\u0430\u0434\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443, \u0430 \u043d\u0443\u043b\u0438 \u2013 \u043d\u043e\u0432\u044b\u0435 \u043a\u0430\u0434\u0440\u044b. \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 <em>flaky_pytest_plugin.py<\/em> \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443.&nbsp;<\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f: \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u043e\u0442\u0432\u0435\u0442, \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043b\u0430\u0433\u0438\u043d pytest-flaky \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e. \u041c\u043e\u0439 \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439, \u043e\u043d \u0435\u0449\u0435 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 (\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 pytest-flaky \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e \u0435\u0449\u0435 \u0440\u0430\u0437.<\/p>\n<p>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0437\u0430\u0433\u0430\u0434\u043a\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0430 \u0432 \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b: \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0434\u0432\u0430\u0436\u0434\u044b, \u0442\u0435\u043b\u043e \u0442\u0435\u0441\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0434\u0432\u0430\u0436\u0434\u044b.&nbsp;<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0442\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0438\u0441\u0447\u0435\u0437\u043b\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 pytest-flaky \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0435\u0433\u043e \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<p>\u0412\u043e\u0442 \u0432\u0430\u043c \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0432 <a href=\"https:\/\/nedbatchelder.com\/text\/machete.html\">\u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u0430\u0447\u0435\u0442\u0435<\/a>, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445. \u042f \u0441\u043b\u043e\u043c\u0430\u043b \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0433\u0440\u0443\u0431\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043d\u0435 \u0437\u043d\u0430\u044f, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e, \u043d\u043e \u043e\u043d\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0433\u043b\u0443\u043f\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432. \u0412\u043e\u0442 \u0432\u0430\u043c \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432:<\/p>\n<pre><code class=\"python\">setup_test                       &lt;module&gt; :  3  igor.py:424                           main :  3  igor.py:416            do_test_with_tracer :  3  igor.py:216                      run_tests :  3  igor.py:133                           main :  3  _pytest\/config\/__init__.py:84                       __call__ :  3  pluggy\/hooks.py:286                      _hookexec :  3  pluggy\/manager.py:93                       &lt;lambda&gt; :  3  pluggy\/manager.py:84                     _multicall :  3  pluggy\/callers.py:187            pytest_cmdline_main :  3  _pytest\/main.py:243                   wrap_session :  3  _pytest\/main.py:206                          _main :  3  _pytest\/main.py:250                       __call__ :  3  pluggy\/hooks.py:286                      _hookexec :  3  pluggy\/manager.py:93                       &lt;lambda&gt; :  3  pluggy\/manager.py:84                     _multicall :  3  pluggy\/callers.py:187             pytest_runtestloop :  3  _pytest\/main.py:271                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187        pytest_runtest_protocol :  1  flaky\/flaky_pytest_plugin.py:94        pytest_runtest_protocol :  0  _pytest\/runner.py:78                runtestprotocol :  0  _pytest\/runner.py:87                call_and_report :  0  flaky\/flaky_pytest_plugin.py:138              call_runtest_hook :  0  _pytest\/runner.py:197                      from_call :  0  _pytest\/runner.py:226                       &lt;lambda&gt; :  0  _pytest\/runner.py:198                       __call__ :  0  pluggy\/hooks.py:286                      _hookexec :  0  pluggy\/manager.py:93                       &lt;lambda&gt; :  0  pluggy\/manager.py:84                     _multicall :  0  pluggy\/callers.py:187           pytest_runtest_setup :  0  _pytest\/runner.py:116                        prepare :  0  _pytest\/runner.py:362                          setup :  0  _pytest\/python.py:1468                   fillfixtures :  0  _pytest\/fixtures.py:296                  _fillfixtures :  0  _pytest\/fixtures.py:469                getfixturevalue :  0  _pytest\/fixtures.py:479         _get_active_fixturedef :  0  _pytest\/fixtures.py:502         _compute_fixture_value :  0  _pytest\/fixtures.py:587                        execute :  0  _pytest\/fixtures.py:894                       __call__ :  0  pluggy\/hooks.py:286                      _hookexec :  0  pluggy\/manager.py:93                       &lt;lambda&gt; :  0  pluggy\/manager.py:84                     _multicall :  0  pluggy\/callers.py:187           pytest_fixture_setup :  0  _pytest\/fixtures.py:936              call_fixture_func :  0  _pytest\/fixtures.py:795              connect_to_pytest :  0  tests\/mixins.py:33                     setup_test :  0  tests\/test_process.py:1651<\/code><\/pre>\n<p>\u0422\u0440\u043e\u0439\u043a\u0438 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 <code>_pytest\/main.py:271<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0438 \u044d\u0442\u043e \u043a\u0440\u0443\u0442\u043e!<\/p>\n<hr>\n<blockquote>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435<a href=\"https:\/\/otus.pw\/3A4o\/\"> &#171;<strong>Python Developer. Professional<\/strong>&#171;<\/a> <\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440<a href=\"https:\/\/otus.pw\/fIEN\/\"> <strong>\u00ab\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Python 3.10\u00bb<\/strong><\/a><\/p>\n<\/blockquote>\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\/company\/otus\/blog\/555278\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/555278\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430<a href=\"https:\/\/otus.pw\/3A4o\/\"> &#171;<strong>Python Developer. Professional<\/strong>&#171;.<\/a><\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u0435\u043c\u043e-\u0443\u0440\u043e\u043a<a href=\"https:\/\/otus.pw\/fIEN\/\"> <strong>\u00ab\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Python 3.10\u00bb.<\/strong> <\/a>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 PEP\u044b \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0440\u0435\u043b\u0438\u0437 Python 3.10. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438.  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0430\u0434\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Python, \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u043e\u0439 <a href=\"https:\/\/nedbatchelder.com\/text\/machete.html\">\u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u0430\u0447\u0435\u0442\u0435<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d, \u0442\u043e \u043f\u043e\u044f\u0441\u043d\u044e, \u0440\u0435\u0436\u0438\u043c \u00ab\u043c\u0430\u0447\u0435\u0442\u0435\u00bb \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0433\u0440\u0443\u0431\u044b\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.&nbsp;<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e. \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 <em>coverage.py<\/em>. \u0420\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0435\u0433\u043e \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u0436, \u0441\u0442\u0440\u0430\u043d\u043d\u043e: \u0434\u0432\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0435\u0449\u0435 \u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u043e\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430 \u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f. \u042f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0438\u0437 <code>unittest.TestCase<\/code>, \u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u00ab\u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043e\u043a\u00bb \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u0442\u043e\u043a\u0430 \u043a\u043e\u0434\u0430. \u0414\u0443\u043c\u0430\u044f \u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u043c\u043e\u0438 \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043a\u0438 \u0431\u044b\u043b\u0438 \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a\u0438\u043c\u0438, \u043b\u0438\u0431\u043e \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043a\u0440\u0430\u0435\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a pytest \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430? \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<pre><code class=\"python\">def setup_test(self):     import inspect     project_home = \"\/Users\/ned\/coverage\"     site_packages = \".tox\/py39\/lib\/python3.9\/site-packages\/\"     with open(\"\/tmp\/foo.txt\", \"a\") as foo:         print(\"setup_test\", file=foo)         for t in inspect.stack()[::-1]:             # t is (frame, filename, lineno, function, code_context, index)             frame, filename, lineno, function = t[:4]             filename = os.path.relpath(filename, project_home)             filename = filename.replace(site_packages, \"\")             show = \"%30s : %s:%d\" % (function, filename, lineno)             print(show, file=foo)<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043c\u043e\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0430\u0434\u0440\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u044f \u043f\u0438\u0448\u0443 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u041f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0434\u0435\u043b\u0430\u044e \u0438\u0445 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u0438 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u044e\u0441\u044c \u043e\u0442 \u043f\u0443\u0442\u0435\u0439 \u043a \u043f\u0430\u043a\u0435\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430, \u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0435\u043a\u0430, \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u041d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438:<\/p>\n<pre><code class=\"python\">setup_test                       &lt;module&gt; : igor.py:424                           main : igor.py:416            do_test_with_tracer : igor.py:216                      run_tests : igor.py:133                           main : _pytest\/config\/__init__.py:84                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187            pytest_cmdline_main : _pytest\/main.py:243                   wrap_session : _pytest\/main.py:206                          _main : _pytest\/main.py:250                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187             pytest_runtestloop : _pytest\/main.py:271                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187        pytest_runtest_protocol : flaky\/flaky_pytest_plugin.py:94        pytest_runtest_protocol : _pytest\/runner.py:78                runtestprotocol : _pytest\/runner.py:87                call_and_report : flaky\/flaky_pytest_plugin.py:138              call_runtest_hook : _pytest\/runner.py:197                      from_call : _pytest\/runner.py:226                       &lt;lambda&gt; : _pytest\/runner.py:198                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187           pytest_runtest_setup : _pytest\/runner.py:116                        prepare : _pytest\/runner.py:362                          setup : _pytest\/python.py:1468                   fillfixtures : _pytest\/fixtures.py:296                  _fillfixtures : _pytest\/fixtures.py:469                getfixturevalue : _pytest\/fixtures.py:479         _get_active_fixturedef : _pytest\/fixtures.py:502         _compute_fixture_value : _pytest\/fixtures.py:587                        execute : _pytest\/fixtures.py:894                       __call__ : pluggy\/hooks.py:286                      _hookexec : pluggy\/manager.py:93                       &lt;lambda&gt; : pluggy\/manager.py:84                     _multicall : pluggy\/callers.py:187           pytest_fixture_setup : _pytest\/fixtures.py:936              call_fixture_func : _pytest\/fixtures.py:795              connect_to_pytest : tests\/mixins.py:33                     setup_test : tests\/test_process.py:1651<\/code><\/pre>\n<p>\u042f \u043d\u0430\u0434\u0435\u044f\u043b\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438, \u0438 \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0434\u0430\u0441\u0442 \u043c\u043d\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0432\u0441\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e, \u0442\u043e \u0434\u0435\u043b\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0430\u0445. \u041d\u043e \u043a\u0430\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0445 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430?<\/p>\n<p>\u0411\u0443\u0434\u044c \u044f \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043a\u043e\u0434\u043e\u043c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u043e\u0434\u043d\u0430 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u0441\u0442\u043e. \u041d\u043e pytest \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439, \u0438 \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043c. \u0423 \u043c\u0435\u043d\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 pytest, \u0442\u0430\u043a \u0447\u0442\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u0434\u0435\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0435.<\/p>\n<p>\u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0435\u043a\u0430 \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432: \u043a\u0442\u043e \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0438 \u043e\u0442\u043a\u0443\u0434\u0430. \u041d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u0435\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0421\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043a\u0430\u0434\u0440 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 (\u043e\u0434\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b), \u0430 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u043a\u0430\u0434\u0440 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f (\u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430). \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043a\u0430\u0434\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0435\u043a\u0430 \u043a \u0441\u0442\u0435\u043a\u0443, \u0442\u043e \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u0446\u0438\u043a\u043b \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u0431\u044b\u043b\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c id \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0444\u0440\u0435\u0439\u043c\u0430, \u043d\u043e id \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0438\u043c \u0442\u0435\u0433\u0438? \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u043c \u043a \u0444\u0440\u0435\u0439\u043c\u0443.&nbsp; \u0412 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 \u044f \u043f\u0438\u0448\u0443 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u0430\u0434\u0440.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0446\u0438\u043a\u043b \u043f\u043e \u043a\u0430\u0434\u0440\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430. \u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u0442, \u0442\u043e \u043e\u043d\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u0430 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0441\u0442\u0435\u043a\u0430, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/p>\n<pre><code class=\"python\">def setup_test(self):     import inspect     project_home = \"\/Users\/ned\/coverage\"     site_packages = \".tox\/py39\/lib\/python3.9\/site-packages\/\"     with open(\"\/tmp\/foo.txt\", \"a\") as foo:         print(\"setup_test\", file=foo)         for t in inspect.stack()[::-1]:             # t is (frame, filename, lineno, function, code_context, index)             frame, filename, lineno, function = t[:4]             visits = frame.f_locals.get(\"$visits\", 0)       ## new             frame.f_locals[\"$visits\"] = visits + 1          ## new             filename = os.path.relpath(filename, project_home)             filename = filename.replace(site_packages, \"\")             show = \"%30s :  %d  %s:%d\" % (function, visits, filename, lineno)             print(show, file=foo)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0435\u043a\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435, \u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0412\u043e\u0442 \u0441\u0442\u0435\u043a \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\">setup_test                       &lt;module&gt; :  1  igor.py:424                           main :  1  igor.py:416            do_test_with_tracer :  1  igor.py:216                      run_tests :  1  igor.py:133                           main :  1  _pytest\/config\/__init__.py:84                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187            pytest_cmdline_main :  1  _pytest\/main.py:243                   wrap_session :  1  _pytest\/main.py:206                          _main :  1  _pytest\/main.py:250                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187             pytest_runtestloop :  1  _pytest\/main.py:271                       __call__ :  1  pluggy\/hooks.py:286                      _hookexec :  1  pluggy\/manager.py:93                       &lt;lambda&gt; :  1  pluggy\/manager.py:84                     _multicall :  1  pluggy\/callers.py:187        pytest_runtest_protocol :  1  flaky\/flaky_pytest_plugin.py:94        pytest_runtest_protocol :  0  _pytest\/runner.py:78                runtestprotocol :  0  _pytest\/runner.py:87                call_and_report :  0  flaky\/flaky_pytest_plugin.py:138              call_runtest_hook :  0  _pytest\/runner.py:197                      from_call :  0  _pytest\/runner.py:226                       &lt;lambda&gt; :  0  _pytest\/runner.py:198                       __call__ :  0  pluggy\/hooks.py:286                      _hookexec :  0  pluggy\/manager.py:93                       &lt;lambda&gt; :  0  pluggy\/manager.py:84                     _multicall :  0  pluggy\/callers.py:187           pytest_runtest_setup :  0  _pytest\/runner.py:116                        prepare :  0  _pytest\/runner.py:362                          setup :  0  _pytest\/python.py:1468                   fillfixtures :  0  _pytest\/fixtures.py:296                  _fillfixtures :  0  _pytest\/fixtures.py:469                getfixturevalue :  0  _pytest\/fixtures.py:479         _get_active_fixturedef :  0  _pytest\/fixtures.py:502         _compute_fixture_value :  0  _pytest\/fixtures.py:587                        execute :  0  <\/code><\/pre>\n<\/hr>\n<\/blockquote>\n<\/div>\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-322399","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322399","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=322399"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322399\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}