{"id":398070,"date":"2024-06-29T13:51:05","date_gmt":"2024-06-29T13:51:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398070"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398070","title":{"rendered":"<span>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0443 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0437\u0430 \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/480\/ae9\/7af\/480ae97afd8622c323ae7acea401b292.png\" width=\"1561\" height=\"881\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/480\/ae9\/7af\/480ae97afd8622c323ae7acea401b292.png\"\/><figcaption><\/figcaption><\/figure>\n<p> \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0434\u044f\u0434\u044f \u0412\u043e\u0432\u0430, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u043b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u043d\u0430\u0442 Robot Framework. \u0414\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u043b \u0432 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c slack-\u0447\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p> \u041d\u043e, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439, \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0431\u0435\u043b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 pytest \u2014 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432. \u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438, \u0443 Robot Framework \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p> \u041f\u043e\u0441\u043b\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/maxilect\/blog\/521620\/\"><u>\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0438 \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442\u0432\u0435\u0447\u0443 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<hr\/>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442-\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0448\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0440\u0441 \u0433\u0435\u043d\u0435\u0442\u0438\u043a\u0438, \u043a\u0435\u0439\u0441 \u043f\u0440\u043e \u0433\u043e\u0440\u043e\u0448\u0435\u043a.<\/p>\n<p>\u00a0 \u0413\u043e\u0440\u043e\u0445 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0446\u0432\u0435\u0442 (Color) \u0438 \u0442\u0438\u043f (Kind):<\/p>\n<pre><code class=\"python\">from colors import Color from kinds import Kind    class Peas:       color: Color     kind: Kind       def __init__(self, color: Color, kind: Kind):         self.color = color         self.kind = kind       def __str__(self):         return f\"{self.color.name().capitalize()} {self.kind.name()} \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"<\/code><\/pre>\n<p> \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c: \u043a\u043b\u0430\u0441\u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>__str__()<\/code> \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0440\u0442\u0430 \u0433\u043e\u0440\u043e\u0445\u0430. \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u00ab\u0426\u0432\u0435\u0442\u00bb (Color) \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u2014 \u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u0438 \u0416\u0435\u043b\u0442\u044b\u0439:<\/p>\n<pre><code class=\"python\">class Color:     color_name: str = \"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0446\u0432\u0435\u0442\"       def name(self) -> str:         return self.color_name     class Green(Color):     color_name = \"\u0437\u0435\u043b\u0451\u043d\u044b\u0439\"     class Yellow(Color):     color_name = \"\u0436\u0451\u043b\u0442\u044b\u0439\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u2014 \u0413\u043b\u0430\u0434\u043a\u0438\u0439 \u0438 \u0421\u043c\u043e\u0440\u0449\u0435\u043d\u043d\u044b\u0439 (\u043e\u043d \u0436\u0435 \u2014 \u041c\u043e\u0437\u0433\u043e\u0432\u043e\u0439):<\/p>\n<pre><code class=\"python\">class Kind:     kind_name: str = \"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430\"       def name(self) -> str:         return self.kind_name     class Smooth(Kind):     kind_name = \"\u0433\u043b\u0430\u0434\u043a\u0438\u0439\"     class Brain(Kind):     kind_name = \"\u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439\"<\/code><\/pre>\n<h2>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0435\u0441\u0442<\/h2>\n<p> \u0421\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0440\u0442\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\">from colors import Green, Yellow from kinds import Smooth, Brain from peas import Peas    def test_green_smooth_peas():     peas = Peas(Green(), Smooth())     assert str(peas) == \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u0433\u043b\u0430\u0434\u043a\u0438\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_yellow_smooth_peas():     peas = Peas(Yellow(), Smooth())     assert str(peas) == \"\u0416\u0451\u043b\u0442\u044b\u0439 \u0433\u043b\u0430\u0434\u043a\u0438\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_green_brain_peas():     peas = Peas(Green(), Brain())     assert str(peas) == \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_yellow_brain_peas():     peas = Peas(Yellow(), Brain())     assert str(peas) == \"\u0416\u0451\u043b\u0442\u044b\u0439 \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"<\/code><\/pre>\n<p> \u042d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u044f \u0436\u0438\u0432\u0443 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443: \u00ab\u0415\u0441\u043b\u0438 \u043f\u0438\u0448\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0432\u0430\u0436\u0434\u044b \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u0435\u043b\u0430\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a!\u00bb<\/p>\n<h2>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u0412\u044b\u043d\u0435\u0441\u0435\u043c \u0446\u0432\u0435\u0442 \u0438 \u0442\u0438\u043f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 (<code>product()<\/code>) \u0441\u043f\u0438\u0441\u043a\u043e\u0432:<\/p>\n<pre><code class=\"python\">from itertools import product from typing import Tuple   from pytest import mark   from colors import Color, Yellow, Green from kinds import Kind, Smooth, Brain from peas import Peas   colors = [(Yellow(), \"\u0416\u0451\u043b\u0442\u044b\u0439\"), (Green(), \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439\")] kind = [(Smooth(), \"\u0433\u043b\u0430\u0434\u043a\u0438\u0439\"), (Brain(), \"\u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439\")] peas_word = \"\u0433\u043e\u0440\u043e\u0448\u0435\u043a\"   sets = list(product(colors, kind))    @mark.parametrize(\"color_info,kind_info\", sets) def test_peas_str(color_info: Tuple[Color, str], kind_info: Tuple[Kind, str]):     color, color_str = color_info     kind, kind_str = kind_info     peas = Peas(color, kind)     assert str(peas) == f\"{color_str} {kind_str} {peas_word}.\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0438\u043c\u0435\u0435\u043c \u0442\u0435 \u0436\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>\u00a0\u0418 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u2014 \u0447\u0435\u0440\u043d\u044b\u0439 \u2014 \u0446\u0432\u0435\u0442) \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.<\/p>\n<p> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0447\u0435\u0440\u043d\u044b\u0439 \u0446\u0432\u0435\u0442:<\/p>\n<pre><code class=\"python\">class Black(Color):     color_name = \"\u0447\u0451\u0440\u043d\u044b\u0439\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0442\u0430\u043b\u043e \u0448\u0435\u0441\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0446\u0432\u0435\u0442\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">colors = [(Yellow(), \"\u0416\u0451\u043b\u0442\u044b\u0439\"), (Green(), \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439\"), (Black(), \"\u0427\u0451\u0440\u043d\u044b\u0439\")]<\/code><\/pre>\n<p> \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0438\u0434\u0435\u044f \u044f\u0441\u043d\u0430: \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u043a\u0430\u043c\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0442\u043d\u044f\u043c\u0438.<\/p>\n<h2>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u0435\u0439\u0441\u043e\u0432<\/h2>\n<p> \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0438\u043b\u043e\u0441\u044c \u0432 \u0433\u043b\u0430\u0437\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dc1\/c94\/1aa\/dc1c941aa7d9c86bc36f4e813d8122e4.png\" alt=\"\u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.\" title=\"\u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.\" width=\"268\" height=\"154\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc1\/c94\/1aa\/dc1c941aa7d9c86bc36f4e813d8122e4.png\"\/><figcaption>\u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.<\/figcaption><\/figure>\n<p> \u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044e. \u041e\u0447\u0435\u043d\u044c \u0436\u0430\u043b\u044c, \u043d\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u043e\u043d\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442, \u0430 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"python\">test_names = [   f\"{params[0][0].__class__.__qualname__} - {params[1][0].__class__.__qualname__}\"    for params in sets ]<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@mark.parametrize(\"color_info,kind_info\", sets, ids=test_names)<\/code><\/pre>\n<p>\u0421\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b5\/bd1\/ad8\/5b5bd1ad869e96f6b72c0b9b9d572a7e.png\" alt=\"\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.\" title=\"\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.\" width=\"275\" height=\"155\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b5\/bd1\/ad8\/5b5bd1ad869e96f6b72c0b9b9d572a7e.png\"\/><figcaption>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/figcaption><\/figure>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u041b\u0443\u0447\u0448\u0435\u0435 \u2014 \u0432\u0440\u0430\u0433 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0442\u0440\u0430\u0434\u0430\u044e \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439. \u041a\u0441\u0442\u0430\u0442\u0438, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u00a0\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>\u00a0\u0415\u0441\u0442\u044c \u0432 pytest \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 pytest_generate_tests. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(metafunc):     args = []     names = []     for color_info, kind_info in product(colors, kinds):         color, color_str = color_info         kind, kind_str = kind_info         args.append([color, color_str, kind, kind_str])         names.append(f\"{color.__class__.__qualname__} - {kind.__class__.__qualname__}\")     metafunc.parametrize(\"color,color_str,kind,kind_str\", args, ids=names)     def test_peas_str(color: Color, color_str: str, kind: Kind, kind_str: str):     peas = Peas(color, kind)     assert str(peas) == f\"{color_str} {kind_str} {peas_word}.\"<\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0441\u0438\u043d\u043e\u043d\u0438\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0448\u0435, \u043d\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430<\/h2>\n<p> \u0418\u043d\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0443\u0441\u0442\u0430\u0432\u0448\u0438\u0435 \u043e\u0442 \u0442\u043e\u043d\u043d\u044b issue, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043b\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u0437 \u0440\u043e\u0433\u0430 \u0438\u0437\u043e\u0431\u0438\u043b\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0440\u043e\u0441\u044f\u0442 \u043c\u0435\u043d\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u0435\u0439\u0441\u044b. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0430\u043b\u0438\u0442\u044c \u0431\u0438\u043b\u0434, \u0437\u043d\u0430\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442.<\/p>\n<p> \u041e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u044b\u0442. \u041d\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434 \u00ab\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439\u00bb \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043e\u0431\u044b\u0447\u043d\u044b\u043c <code>@mark.parametrize<\/code>.<\/p>\n<p> \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u044b\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e (\u044d\u0442\u043e \u043d\u0435 \u0432\u0430\u043b\u0438\u0442 \u0431\u0438\u043b\u0434, \u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443), \u0442\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>@mark.xfail<\/code>. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>reason<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 issue \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0430\u0433-\u0442\u0440\u0435\u043a\u0435\u0440\u0435.<\/p>\n<p> \u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043f\u043e \u0422\u0417 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0435\u0449\u0435 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442 \u0433\u043e\u0440\u043e\u0448\u043a\u0430. \u041d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441 \u043d\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u043e\u0440\u0442\u0430\u0447\u0438\u043b\u0438, \u0438 \u0442\u0435\u0441\u0442\u044b \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u0430\u0434\u0430\u044e\u0442. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0441\u044f\u0442 \u043d\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u044b \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438, \u043d\u043e \u043d\u0435 \u0432\u0430\u043b\u0438\u043b\u0438 \u0431\u0438\u043b\u0434.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/255\/eb7\/404\/255eb7404558e872d41144102ebcec0e.png\" alt=\"\u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0443\u043f\u0430\u043b\u0438 -- \u0431\u0438\u043b\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.\" title=\"\u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0443\u043f\u0430\u043b\u0438 -- \u0431\u0438\u043b\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.\" width=\"358\" height=\"250\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/255\/eb7\/404\/255eb7404558e872d41144102ebcec0e.png\"\/><figcaption>\u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0443\u043f\u0430\u043b\u0438 &#8212; \u0431\u0438\u043b\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/figcaption><\/figure>\n<p> \u041d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0435\u0439\u0441 \u0441\u0435\u0440\u044b\u043c. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">params = [color, color_str, kind, kind_str] args.append(   params if not isinstance(color, Purple) else pytest.param(*params, marks=pytest.mark.xfail(     reason=\"Not implemented yet.\")) )<\/code><\/pre>\n<p> \u0412\u0435\u0441\u044c \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(metafunc):     args = []     names = []     for color_info, kind_info in product(colors, kinds):         color, color_str = color_info         kind, kind_str = kind_info         params = [color, color_str, kind, kind_str]         args.append(params if not isinstance(color, Purple) else pytest.param(*params, marks=pytest.mark.xfail(             reason=\"Not implemented yet.\")))         names.append(f\"{color.__class__.__qualname__} - {kind.__class__.__qualname__}\")     metafunc.parametrize(\"color,color_str,kind,kind_str\", args, ids=names)<\/code><\/pre>\n<p> \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0441\u0435\u0440\u044b\u043c \u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0430\u043b\u0438\u0442\u044c \u0431\u0438\u043b\u0434 \u0432 CI:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c7e\/a64\/1de\/c7ea641de4734aa3459247e184def8c8.png\" alt=\"\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442.\" title=\"\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442.\" width=\"362\" height=\"247\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c7e\/a64\/1de\/c7ea641de4734aa3459247e184def8c8.png\"\/><figcaption>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442.<\/figcaption><\/figure>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0435\u0449\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p> \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434 <code>@mark.parametrize(\"param\", self.params)<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>self<\/code>. \u0418 \u0442\u0443\u0442 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a <code>pytest_generate_tests<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0435\u0433\u043e \u0432 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(self, metafunc):     metafunc.parametrize(\"param\", self.params)<\/code><\/pre>\n<p> \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p> \u0418 \u0435\u0449\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0438\u043b\u0438 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 <code>pytest_generate_tests<\/code> (\u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0441 test_ \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e), \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>metafunc<\/code> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>metafunc.function.__name__<\/code> \u2014 \u0442\u0430\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u0442\u0435\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<pre><code class=\"python\">class TestExample:     params: List[str] = [\u201cI\u201d, \u201clike\u201d, \u201cpython\u201d]       def pytest_generate_tests(self, metafunc):         if metafunc.function.__name__ == \u201ctest_for_generate\u201d:             metafunc.parametrize(\"param\", self.params)          def test_for_generate(self, param: str):         print(param)       def test_not_for_generate(self, param: str):         print(param)<\/code><\/pre>\n<p>&#8230;\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f <code>test_for_generate<\/code>, \u043d\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f <code>test_not_for_generate<\/code>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p> \u041d\u0430 \u043c\u043e\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 pair-wise \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u044b\u0442\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0432 \u043a\u0430\u043a\u043e\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0430. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0442\u0435\u0441\u0442\u044b, \u044f \u043c\u043e\u0433\u0443 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f 100%-\u0433\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0442\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p> \u0412\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0447\u0442\u0438 11 \u0442\u044b\u0441\u044f\u0447 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e, \u043a\u0430\u043a \u0431\u044b \u044f \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u043b \u0431\u0435\u0437 \u0442\u0430\u043a\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u00a0\u0412\u0441\u0435\u043c \u0437\u0435\u043b\u0435\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/591227\/\"> https:\/\/habr.com\/ru\/articles\/591227\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p> \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0434\u044f\u0434\u044f \u0412\u043e\u0432\u0430, \u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u043b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u043d\u0430\u0442 Robot Framework. \u0414\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u043b \u0432 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c slack-\u0447\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p> \u041d\u043e, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439, \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0431\u0435\u043b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 pytest \u2014 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432. \u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438, \u0443 Robot Framework \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p> \u041f\u043e\u0441\u043b\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/maxilect\/blog\/521620\/\"><u>\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0438 \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442\u0432\u0435\u0447\u0443 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<hr\/>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442-\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0448\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0440\u0441 \u0433\u0435\u043d\u0435\u0442\u0438\u043a\u0438, \u043a\u0435\u0439\u0441 \u043f\u0440\u043e \u0433\u043e\u0440\u043e\u0448\u0435\u043a.<\/p>\n<p>\u00a0 \u0413\u043e\u0440\u043e\u0445 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0446\u0432\u0435\u0442 (Color) \u0438 \u0442\u0438\u043f (Kind):<\/p>\n<pre><code class=\"python\">from colors import Color from kinds import Kind    class Peas:       color: Color     kind: Kind       def __init__(self, color: Color, kind: Kind):         self.color = color         self.kind = kind       def __str__(self):         return f\"{self.color.name().capitalize()} {self.kind.name()} \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"<\/code><\/pre>\n<p> \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c: \u043a\u043b\u0430\u0441\u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>__str__()<\/code> \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0440\u0442\u0430 \u0433\u043e\u0440\u043e\u0445\u0430. \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u00ab\u0426\u0432\u0435\u0442\u00bb (Color) \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u2014 \u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u0438 \u0416\u0435\u043b\u0442\u044b\u0439:<\/p>\n<pre><code class=\"python\">class Color:     color_name: str = \"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0446\u0432\u0435\u0442\"       def name(self) -> str:         return self.color_name     class Green(Color):     color_name = \"\u0437\u0435\u043b\u0451\u043d\u044b\u0439\"     class Yellow(Color):     color_name = \"\u0436\u0451\u043b\u0442\u044b\u0439\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u2014 \u0413\u043b\u0430\u0434\u043a\u0438\u0439 \u0438 \u0421\u043c\u043e\u0440\u0449\u0435\u043d\u043d\u044b\u0439 (\u043e\u043d \u0436\u0435 \u2014 \u041c\u043e\u0437\u0433\u043e\u0432\u043e\u0439):<\/p>\n<pre><code class=\"python\">class Kind:     kind_name: str = \"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430\"       def name(self) -> str:         return self.kind_name     class Smooth(Kind):     kind_name = \"\u0433\u043b\u0430\u0434\u043a\u0438\u0439\"     class Brain(Kind):     kind_name = \"\u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439\"<\/code><\/pre>\n<h2>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0435\u0441\u0442<\/h2>\n<p> \u0421\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0440\u0442\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\">from colors import Green, Yellow from kinds import Smooth, Brain from peas import Peas    def test_green_smooth_peas():     peas = Peas(Green(), Smooth())     assert str(peas) == \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u0433\u043b\u0430\u0434\u043a\u0438\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_yellow_smooth_peas():     peas = Peas(Yellow(), Smooth())     assert str(peas) == \"\u0416\u0451\u043b\u0442\u044b\u0439 \u0433\u043b\u0430\u0434\u043a\u0438\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_green_brain_peas():     peas = Peas(Green(), Brain())     assert str(peas) == \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"     def test_yellow_brain_peas():     peas = Peas(Yellow(), Brain())     assert str(peas) == \"\u0416\u0451\u043b\u0442\u044b\u0439 \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0433\u043e\u0440\u043e\u0448\u0435\u043a.\"<\/code><\/pre>\n<p> \u042d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u044f \u0436\u0438\u0432\u0443 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443: \u00ab\u0415\u0441\u043b\u0438 \u043f\u0438\u0448\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0432\u0430\u0436\u0434\u044b \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u0435\u043b\u0430\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a!\u00bb<\/p>\n<h2>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u0412\u044b\u043d\u0435\u0441\u0435\u043c \u0446\u0432\u0435\u0442 \u0438 \u0442\u0438\u043f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 (<code>product()<\/code>) \u0441\u043f\u0438\u0441\u043a\u043e\u0432:<\/p>\n<pre><code class=\"python\">from itertools import product from typing import Tuple   from pytest import mark   from colors import Color, Yellow, Green from kinds import Kind, Smooth, Brain from peas import Peas   colors = [(Yellow(), \"\u0416\u0451\u043b\u0442\u044b\u0439\"), (Green(), \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439\")] kind = [(Smooth(), \"\u0433\u043b\u0430\u0434\u043a\u0438\u0439\"), (Brain(), \"\u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439\")] peas_word = \"\u0433\u043e\u0440\u043e\u0448\u0435\u043a\"   sets = list(product(colors, kind))    @mark.parametrize(\"color_info,kind_info\", sets) def test_peas_str(color_info: Tuple[Color, str], kind_info: Tuple[Kind, str]):     color, color_str = color_info     kind, kind_str = kind_info     peas = Peas(color, kind)     assert str(peas) == f\"{color_str} {kind_str} {peas_word}.\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0438\u043c\u0435\u0435\u043c \u0442\u0435 \u0436\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>\u00a0\u0418 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u2014 \u0447\u0435\u0440\u043d\u044b\u0439 \u2014 \u0446\u0432\u0435\u0442) \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.<\/p>\n<p> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0447\u0435\u0440\u043d\u044b\u0439 \u0446\u0432\u0435\u0442:<\/p>\n<pre><code class=\"python\">class Black(Color):     color_name = \"\u0447\u0451\u0440\u043d\u044b\u0439\"<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0442\u0430\u043b\u043e \u0448\u0435\u0441\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0446\u0432\u0435\u0442\u043e\u0432 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">colors = [(Yellow(), \"\u0416\u0451\u043b\u0442\u044b\u0439\"), (Green(), \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439\"), (Black(), \"\u0427\u0451\u0440\u043d\u044b\u0439\")]<\/code><\/pre>\n<p> \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0438\u0434\u0435\u044f \u044f\u0441\u043d\u0430: \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u043a\u0430\u043c\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0442\u043d\u044f\u043c\u0438.<\/p>\n<h2>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u0435\u0439\u0441\u043e\u0432<\/h2>\n<p> \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0438\u043b\u043e\u0441\u044c \u0432 \u0433\u043b\u0430\u0437\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432:<\/p>\n<figure class=\"\"><figcaption>\u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0435\u0439\u0441\u043e\u0432.<\/figcaption><\/figure>\n<p> \u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044e. \u041e\u0447\u0435\u043d\u044c \u0436\u0430\u043b\u044c, \u043d\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u043e\u043d\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442, \u0430 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"python\">test_names = [   f\"{params[0][0].__class__.__qualname__} - {params[1][0].__class__.__qualname__}\"    for params in sets ]<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@mark.parametrize(\"color_info,kind_info\", sets, ids=test_names)<\/code><\/pre>\n<p>\u0421\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e:<\/p>\n<figure class=\"\"><figcaption>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/figcaption><\/figure>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u041b\u0443\u0447\u0448\u0435\u0435 \u2014 \u0432\u0440\u0430\u0433 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0442\u0440\u0430\u0434\u0430\u044e \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439. \u041a\u0441\u0442\u0430\u0442\u0438, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u00a0\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>\u00a0\u0415\u0441\u0442\u044c \u0432 pytest \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 pytest_generate_tests. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(metafunc):     args = []     names = []     for color_info, kind_info in product(colors, kinds):         color, color_str = color_info         kind, kind_str = kind_info         args.append([color, color_str, kind, kind_str])         names.append(f\"{color.__class__.__qualname__} - {kind.__class__.__qualname__}\")     metafunc.parametrize(\"color,color_str,kind,kind_str\", args, ids=names)     def test_peas_str(color: Color, color_str: str, kind: Kind, kind_str: str):     peas = Peas(color, kind)     assert str(peas) == f\"{color_str} {kind_str} {peas_word}.\"<\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0441\u0438\u043d\u043e\u043d\u0438\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0448\u0435, \u043d\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430<\/h2>\n<p> \u0418\u043d\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0443\u0441\u0442\u0430\u0432\u0448\u0438\u0435 \u043e\u0442 \u0442\u043e\u043d\u043d\u044b issue, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043b\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u0437 \u0440\u043e\u0433\u0430 \u0438\u0437\u043e\u0431\u0438\u043b\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0440\u043e\u0441\u044f\u0442 \u043c\u0435\u043d\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u0435\u0439\u0441\u044b. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0430\u043b\u0438\u0442\u044c \u0431\u0438\u043b\u0434, \u0437\u043d\u0430\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442.<\/p>\n<p> \u041e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u044b\u0442. \u041d\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434 \u00ab\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439\u00bb \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043e\u0431\u044b\u0447\u043d\u044b\u043c <code>@mark.parametrize<\/code>.<\/p>\n<p> \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u044b\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e (\u044d\u0442\u043e \u043d\u0435 \u0432\u0430\u043b\u0438\u0442 \u0431\u0438\u043b\u0434, \u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443), \u0442\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>@mark.xfail<\/code>. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>reason<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 issue \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0430\u0433-\u0442\u0440\u0435\u043a\u0435\u0440\u0435.<\/p>\n<p> \u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043f\u043e \u0422\u0417 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0435\u0449\u0435 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442 \u0433\u043e\u0440\u043e\u0448\u043a\u0430. \u041d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441 \u043d\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u043e\u0440\u0442\u0430\u0447\u0438\u043b\u0438, \u0438 \u0442\u0435\u0441\u0442\u044b \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u0430\u0434\u0430\u044e\u0442. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0441\u044f\u0442 \u043d\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u044b \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438, \u043d\u043e \u043d\u0435 \u0432\u0430\u043b\u0438\u043b\u0438 \u0431\u0438\u043b\u0434.<\/p>\n<figure class=\"\"><figcaption>\u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0443\u043f\u0430\u043b\u0438 &#8212; \u0431\u0438\u043b\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/figcaption><\/figure>\n<p> \u041d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0435\u0439\u0441 \u0441\u0435\u0440\u044b\u043c. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">params = [color, color_str, kind, kind_str] args.append(   params if not isinstance(color, Purple) else pytest.param(*params, marks=pytest.mark.xfail(     reason=\"Not implemented yet.\")) )<\/code><\/pre>\n<p> \u0412\u0435\u0441\u044c \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(metafunc):     args = []     names = []     for color_info, kind_info in product(colors, kinds):         color, color_str = color_info         kind, kind_str = kind_info         params = [color, color_str, kind, kind_str]         args.append(params if not isinstance(color, Purple) else pytest.param(*params, marks=pytest.mark.xfail(             reason=\"Not implemented yet.\")))         names.append(f\"{color.__class__.__qualname__} - {kind.__class__.__qualname__}\")     metafunc.parametrize(\"color,color_str,kind,kind_str\", args, ids=names)<\/code><\/pre>\n<p> \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0441\u0435\u0440\u044b\u043c \u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0430\u043b\u0438\u0442\u044c \u0431\u0438\u043b\u0434 \u0432 CI:<\/p>\n<figure class=\"\"><figcaption>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442.<\/figcaption><\/figure>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0435\u0449\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p> \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434 <code>@mark.parametrize(\"param\", self.params)<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>self<\/code>. \u0418 \u0442\u0443\u0442 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a <code>pytest_generate_tests<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0435\u0433\u043e \u0432 \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"python\">def pytest_generate_tests(self, metafunc):     metafunc.parametrize(\"param\", self.params)<\/code><\/pre>\n<p> \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p> \u0418 \u0435\u0449\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0438\u043b\u0438 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 <code>pytest_generate_tests<\/code> (\u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0441 test_ \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e), \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>metafunc<\/code> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>metafunc.function.__name__<\/code> \u2014 \u0442\u0430\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u0442\u0435\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<pre><code class=\"python\">class TestExample:     params: List[str] = [\u201cI\u201d, \u201clike\u201d, \u201cpython\u201d]       def pytest_generate_tests(self, metafunc):         if metafunc.function.__name__ == \u201ctest_for_generate\u201d:             metafunc.parametrize(\"param\", self.params)          def test_for_generate(self, param: str):         print(param)       def test_not_for_generate(self, param: str):         print(param)<\/code><\/pre>\n<p>&#8230;\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f <code>test_for_generate<\/code>, \u043d\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f <code>test_not_for_generate<\/code>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p> \u041d\u0430 \u043c\u043e\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 pair-wise \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u044b\u0442\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0432 \u043a\u0430\u043a\u043e\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0430. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0442\u0435\u0441\u0442\u044b, \u044f \u043c\u043e\u0433\u0443 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f 100%-\u0433\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0442\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p> \u0412\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0447\u0442\u0438 11 \u0442\u044b\u0441\u044f\u0447 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/div>\n<\/div>\n<\/div>\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-398070","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398070","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=398070"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398070\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}