{"id":463254,"date":"2025-06-13T11:25:48","date_gmt":"2025-06-13T11:25:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=463254"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=463254","title":{"rendered":"<span>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f: PyTest vs RobotFramework<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \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: PyTest \u0438 RobotFramework.<\/p>\n<p>\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f<a href=\"https:\/\/habr.com\/ru\/companies\/maxilect\/articles\/521620\/\"> <u>\u0441\u0442\u0430\u0442\u044c\u044f<\/u><\/a> \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u042f \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5fd\/3b4\/cda\/5fd3b4cda9ae2b6ed00829850c004a9c.jpeg\" alt=\"alt\" title=\"\" width=\"800\" height=\"450\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/5fd\/3b4\/cda\/5fd3b4cda9ae2b6ed00829850c004a9c.jpeg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5fd\/3b4\/cda\/5fd3b4cda9ae2b6ed00829850c004a9c.jpeg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0445\u0430\u0431\u0440-\u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e Robot Framework \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b &#171;\u043d\u0430 \u043b\u0435\u0442\u0443&#187; \u043a\u0430\u043a \u0432 PyTest. <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0442\u044c \u0438 \u043a\u0440\u0438\u0432\u043e, \u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 Robot Framework \u0438 PyTest \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c PyTest \u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441 \u043d\u0438\u043c \u0432\u0441\u0451 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0441\u043e\u0431\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 PyTest \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0442\u0435 \u0436\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f Robot Framework-y.<\/p>\n<h2>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0442\u0443\u0434\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e:\u00a0<\/p>\n<pre><code class=\"python\">\u0422\u0435\u0441\u04421 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(0, 0) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0 \u0422\u0435\u0441\u04422 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(-1, 1) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0 \u2026 \u0422\u0435\u0441\u04429 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(7, 8) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 15<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d79\/c7b\/1df\/d79c7b1df22ceaf5037b57a37332144e.jpeg\" alt=\"alt\" width=\"800\" height=\"450\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d79\/c7b\/1df\/d79c7b1df22ceaf5037b57a37332144e.jpeg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d79\/c7b\/1df\/d79c7b1df22ceaf5037b57a37332144e.jpeg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>alt<\/figcaption><\/div>\n<\/figure>\n<p>\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0434 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439\u0422\u0435\u0441\u0442((0, 0, 0), (-1, 1, 0), ... , (7, 8, 15))<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0439 \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/p>\n<blockquote>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0432 \u043e\u0434\u0438\u043d \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0441\u0442. \u0415\u0441\u043b\u0438 \u0431\u044b\u043b\u043e \u0434\u0435\u0432\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u0445 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0434\u0435\u0432\u044f\u0442\u044c, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u043b\u0438 \u043f\u0430\u0434\u0430\u0442\u044c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.  <\/p>\n<\/blockquote>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0443\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0442\u043e\u043c \u043b\u0435\u0433\u0447\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u00a0\u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0434\u043b\u044f\u00a0\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u043e\u0432, \u0438\u0445 \u043f\u043e\u0432\u0442\u043e\u0440 \u043f\u043b\u043e\u0445\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a<a href=\"https:\/\/devhops.ru\/db\/\"> <\/a>\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u0441\u0442\u0430, \u0430\u00a0\u0432\u00a0\u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0447\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438\u00a0\u2014 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">python -m venv venv<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p> \u0412<a href=\"https:\/\/devhops.ru\/windows\/\"> <\/a>Windows \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"powershell\">.\\venv\\Scripts\\activate<\/code><\/pre>\n<p>\u0412\u00a0Linux\u00a0\u2014 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u2011\u0434\u0440\u0443\u0433\u043e\u043c\u0443:<\/p>\n<pre><code class=\"bash\">source .\/venv\/bin\/activate<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">python -m pip install pytest requests xmlschema robotframework robotframework-datadriver<\/code><\/pre>\n<p>\u041a\u0430\u043a\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437 <strong>requirements.txt<\/strong><\/p>\n<pre><code>pytest==8.3.5 requests==2.32.3 xmlschema==3.4.3 robotframework==7.2.2 robotframework-datadriver==1.11.22<\/code><\/pre>\n<pre><code class=\"bash\">python -m pip install -r requirements.txt<\/code><\/pre>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0437\u0430\u0431\u044b\u043b \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0422\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h2>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>filter_three()<\/strong> \u0438\u0437\u00a0\u043c\u043e\u0434\u0443\u043b\u044f <strong>three_digit.py<\/strong> \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <strong>True<\/strong> \u0435\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u043e\u0435.<\/p>\n<pre><code class=\"python\">def filter_three(x: int) -&gt; bool: return 100 &lt;= x &lt; 1000<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e PyTest \u0438 RF.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>filter_three\/\u00a0 \u251c\u2500\u2500 three_digit.py\u00a0 \u2514\u2500\u2500 tests\u00a0 \u00a0\u00a0\u00a0\u00a0\u251c\u2500\u2500 pytest \u00a0\u00a0\u00a0\u00a0| \u00a0 \u2514\u2500\u2500 test_filter_three.py \u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500 robot\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500 test_filter_three.robot<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>filter_three()<\/strong> \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u00a0\u043d\u0435\u0435 \u043a\u0430\u043a\u00a0\u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435\u00a0\u0442\u0440\u0451\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u0421\u00a0\u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0430\u043a\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. PyTest<\/h3>\n<p>\u041d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u00a0\u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"python\">[      (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442) ]<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432. \u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0445 \u0448\u0435\u0441\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u00a0\u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043c, \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0438\u0445 <strong>test_input<\/strong> \u0438 <strong>expected_result<\/strong><\/p>\n<pre><code class=\"python\">import pytest from three_digit import filter_three   @pytest.mark.parametrize(\"test_input, expected_result\", [     (8, False),     (99, False),     (100, True),     (101, True),     (999, True),     (1000, False) ])  def test_compare(test_input, expected_result):     res = filter_three(test_input)     assert res == expected_result<\/code><\/pre>\n<pre><code class=\"bash\">python -m pytest -v --no-header .\\tests\\pytest\\test_filter_three.py<\/code><\/pre>\n<pre><code class=\"python\">======================== test session starts ========================== collected 6 items tests\/pytest\/test_filter_three.py::test_compare[9-False] PASSED [ 16%] tests\/pytest\/test_filter_three.py::test_compare[99-False] PASSED [ 33%] tests\/pytest\/test_filter_three.py::test_compare[100-True] PASSED [ 50%] tests\/pytest\/test_filter_three.py::test_compare[101-True] PASSED [ 66%] tests\/pytest\/test_filter_three.py::test_compare[999-True] PASSED [ 83%] tests\/pytest\/test_filter_three.py::test_compare[1000-False] PASSED [100%] ========================= 6 passed in 0.02s ===========================<\/code><\/pre>\n<p>\u0414\u043b\u044f\u00a0\u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>pytest.param id=<\/strong><\/p>\n<p>\u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u00a0\u0440\u043e\u0431\u043e\u0442\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0451\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u00a0\u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<pre><code class=\"python\">import pytest from three_digit import filter_three   @pytest.mark.parametrize(\"test_input, expected_result\", [     pytest.param(8, False, id=\"Digit\"),     pytest.param(99, False, id=\"Two Digit Number\"),     pytest.param(100, True, id=\"Lower Border\"),     pytest.param(101, True, id=\"Three Digit Number\"),     pytest.param(999, True, id=\"Upper Border\"),     pytest.param(1000, False, id=\"Four Digit Number\") ])  def test_compare(test_input, expected_result):     res = filter_three(test_input)     assert res == expected_result<\/code><\/pre>\n<pre><code class=\"python\">======================== test session starts ========================== collected 6 items  tests\/pytest\/test_filter_three.py::test_compare[Digit] PASSED [ 16%] tests\/pytest\/test_filter_three.py::test_compare[Two Digit Number] PASSED [ 33%] tests\/pytest\/test_filter_three.py::test_compare[Lower Border] PASSED [ 50%] tests\/pytest\/test_filter_three.py::test_compare[Three Digit Number] PASSED [ 66%] tests\/pytest\/test_filter_three.py::test_compare[Upper Border] PASSED [ 83%] tests\/pytest\/test_filter_three.py::test_compare[Four Digit Number] PASSED [100%] ========================= 6 passed in 0.02s ===========================<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. Robot Framework<\/h3>\n<p>\u0412\u00a0Robot Framework \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<pre><code class=\"python\">*** Settings ***  Library  ..\/..\/three_digit.py  Test Template    Validate Number  *** Test Cases ***    number    expected_result Digit                 8         ${False} Two Digit Number      99        ${False} Lower Border          100       ${True} Three Digit Number    101       ${True} Upper Border          999       ${True} Four Digit Number     1000      ${False}  *** Keywords *** Validate Number    [Arguments]    ${number}    ${expected}    ${res}=    Filter Three    ${number}    Should Be Equal     ${res}    ${expected}<\/code><\/pre>\n<pre><code class=\"bash\">python -m robot .\\tests\\robot\\test_filter_three.robot<\/code><\/pre>\n<pre><code class=\"python\">======================================================================== ====== Test Filter Three  ======================================================================== ====== Digit | PASS | ------------------------------------------------------------------------ ------ Two Digit Number | PASS | ------------------------------------------------------------------------ ------ Lower Border | PASS | ------------------------------------------------------------------------ ------ Three Digit Number | PASS | ------------------------------------------------------------------------ ------ Upper Border | PASS | ------------------------------------------------------------------------ ------ Four Digit Number | PASS | ------------------------------------------------------------------------ ------ Test Filter Three | PASS | 6 tests, 6 passed, 0 failed ========================================================================<\/code><\/pre>\n<p>\u0412\u00a0\u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u043d\u0435\u00a0\u0432\u044b\u044f\u0432\u043b\u0435\u043d\u043e.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0\u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u043d\u0435\u00a0\u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u00a0\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u0435\u0441\u0442. \u0418\u0437\u0443\u0447\u0430\u044f \u0441\u043f\u0435\u0440\u0432\u0430 \u041f\u0440\u0438\u043c\u0435\u0440 1\u00a0\u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u041f\u0440\u0438\u043c\u0435\u0440 2\u00a0\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e, \u043d\u0435\u00a0\u0437\u043d\u0430\u043a\u043e\u043c\u043e\u043c\u0443 \u0441\u00a0PyTest, \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u00a0\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0PyTest \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>parametrize\/  \u251c\u2500\u2500 prod  \u2502 \u251c\u2500\u2500 prod.py  \u2502 \u2514\u2500\u2500 tests  \u2502     \u251c\u2500\u2500 pytest  \u2502     \u2502   \u2514\u2500\u2500 test_prod.py  \u2502     \u2514\u2500\u2500 robot  \u2502         \u2514\u2500\u2500 test_prod.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<pre><code class=\"python\"># prod.py def prod(a, b):     return a * b<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. PyTest<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439. \u0412\u00a0\u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u0440\u0442\u0435\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u043e \u043a\u043e\u0440\u0442\u0435\u0436 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0412\u0442\u043e\u0440\u043e\u0439\u00a0\u2014 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u00a0\u0444\u043e\u0440\u043c\u0430\u0442\u0435 int.<\/p>\n<pre><code class=\"python\">[      ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442) ]<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u043d\u0430\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0443, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0440\u0442\u0435\u0436\u0430 \u0441\u00a0\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/devhops.ru\/code\/python\/functions\/args_kwargs\/\"> *args<\/a>.<\/p>\n<pre><code class=\"python\"># test_prod.py import pytest from prod import prod   @pytest.mark.parametrize(     \"args, expected_result\",     [        pytest.param((0, 0), 0, id=\"zero - zero\"),         pytest.param((7, -8), -56, id=\"positive - negative\"),        pytest.param((13.0, 14), 182, id=\"float positive - positive\"),     ])  def test_param_prod(args, expected_result):     res = prod(*args)     assert res == expected_result<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u00a0\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>prod<\/strong> \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<pre><code class=\"bash\">python -m pytest -v --no-header .\\tests\\pytest\\<\/code><\/pre>\n<pre><code class=\"python\">====================== test session starts ====================== collected 3 items tests\/pytest\/test_prod.py::test_basic_param_prod[zero - zero] PASSED [ 33%] tests\/pytest\/test_prod.py::test_basic_param_prod[positive - negative] PASSED [ 66%] tests\/pytest\/test_prod.py::test_basic_param_prod[float positive - positive] PASSED [100%]  ==================== 3 passed in 0.01s =========================<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. Robot Framework<\/h3>\n<pre><code class=\"python\">*** Settings ***  Library  ..\/..\/prod.py Test Template    Validate Prod  *** Test Cases ***         arg1       arg2     expected_result Zero Zero                  ${0}       ${0}     ${0} Positive Negative          ${7}       ${-8}    ${-56} Float Positive Positive    ${13.0}    ${14}    ${182}   *** Keywords *** Validate Prod     [Arguments]    ${arg1}    ${arg2}    ${expected_result}     ${product}=    Prod    ${arg1}    ${arg2}     Should Be Equal    ${product}    ${expected_result} <\/code><\/pre>\n<pre><code class=\"bash\">python -m robot .\\tests\\robot\\test_prod.robot<\/code><\/pre>\n<pre><code class=\"python\">================================================== ====== Test Prod ================================================== ====== Zero Zero | PASS | -------------------------------------------------- ------ Positive Negative | PASS | -------------------------------------------------- ------ Float Positive Positive | PASS | -------------------------------------------------- ------ Test Prod | PASS | 3 tests, 3 passed, 0 failed ==================================================<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u043d\u0435\u00a0\u0432\u044b\u044f\u0432\u0438\u043b. \u041d\u043e\u00a0\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0435\u043b\u0430 \u043f\u043e\u0439\u0434\u0443\u0442 \u043f\u043e\u0431\u043e\u0434\u0440\u0435\u0435.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 3. \u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u00a0\u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430\u00a0\u0432\u0445\u043e\u0434\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f (\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438) \u0430\u00a0\u043d\u0430\u00a0\u0432\u044b\u0445\u043e\u0434\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0440\u043d\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u0412\u00a0\u043f\u0435\u0440\u0432\u043e\u043c \u043a\u043e\u0440\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u00a0\u0441\u043f\u0438\u0441\u043e\u043a, \u0432\u043e\u00a0\u0432\u0442\u043e\u0440\u043e\u043c\u00a0\u2014 \u043a\u0430\u043a\u00a0\u043a\u043e\u0440\u0442\u0435\u0436. \u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u00a0\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443 \u043e\u0442\u00a0\u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u00a0\u043a\u043e\u0440\u0442\u0435\u0436\u0443.<\/p>\n<pre><code>parametrize\/  \u251c\u2500\u2500 quad  \u2502   \u251c\u2500\u2500 quadratic.py  \u2502   \u2514\u2500\u2500 tests  \u2502       \u251c\u2500\u2500 pytest  \u2502       \u2502   \u2514\u2500\u2500 test_quadratic.py  \u2502       \u2514\u2500\u2500 robot  \u2502           \u2514\u2500\u2500 test_quadratic.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u00a0\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>quad.<\/strong><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.0 PyTest<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\"># test_quadratic.py import pytest from quadratic import quadratic_solve   @pytest.mark.parametrize(\"args, expected_result\", [     pytest.param((1, -3, -4), [4, -1], id=\"two roots\",),     pytest.param((1, -2, 1), [1.0, None], id=\"single root\",),     pytest.param((0, 0, 0), [None, None], id=\"no roots\",) ])  def test_solution(args, expected_result):     res = quadratic_solve(*args)     assert res == expected_result<\/code><\/pre>\n<pre><code class=\"bash\">python -m pytest --no-header -v tests\/pytest\/test_quadratic.py<\/code><\/pre>\n<pre><code class=\"python\">============================ test session starts ===============================  collected 5 items  tests\/test_quadratic.py::test_raises_type_error PASSED [ 20%] tests\/test_quadratic.py::test_result_is_tuple PASSED [ 40%] tests\/test_quadratic.py::test_solution[two roots] PASSED [ 60%] tests\/test_quadratic.py::test_solution[single root] PASSED [ 80%] tests\/test_quadratic.py::test_solution[no roots] PASSED [100%] ============================== 5 passed in 0.01s ==============================<\/code><\/pre>\n<p>\u041a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0446\u0438\u0438 <code>\u2011v<\/code> \u0432\u0441\u0435 \u0442\u0440\u0438 \u0442\u0435\u0441\u0442\u0430 <code>[two roots]<\/code>, <code>[single root]<\/code>, <code>[no roots]<\/code> \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.0 RobotFramework<\/h3>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u0420\u043e\u0431\u043e\u0442\u0443 \u043d\u0443\u0436\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u00a0\u0440\u0430\u0437\u0434\u0435\u043b\u0435 Variables. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c\u00a0\u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<pre><code class=\"python\"># test_quadratic_lists.robot *** Settings ***  Library  ..\/..\/quadratic_lists.py  Test Template    Verify Solution   *** Variables *** @{roots1}=    ${4.0}    ${-1.0} @{roots2}=    ${1.0}    ${None} @{roots3}=    ${None}    ${None}  *** Test Cases ***    a       b        c        expected_result Two Roots             ${1}    ${-3}    ${-4}    ${roots1} Single Root           ${1}    ${-2}    ${1}     ${roots2} No Roots              ${0}    ${0}     ${0}     ${roots3}  *** Keywords *** Verify Solution     [Arguments]    ${a}    ${b}    ${c}    ${expected}     ${res}=    Quadratic Solve    ${a}    ${b}    ${c}     Should Be Equal     ${res}    ${expected} <\/code><\/pre>\n<pre><code class=\"bash\">python -m robot .\\tests\\robot\\test_quadratic_lists.robot<\/code><\/pre>\n<pre><code>======================================================================== ====== Test Quadratic Lists ======================================================================== ====== Two Roots | PASS | ------------------------------------------------------------------------ ------ Single Root | PASS | ------------------------------------------------------------------------ ------ No Roots | PASS | ------------------------------------------------------------------------ ------ Test Quadratic Lists | PASS | 3 tests, 3 passed, 0 failed  ========================================================================<\/code><\/pre>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0442\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u00a0\u043a\u043e\u0440\u0442\u0435\u0436<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 3.1 PyTest<\/h2>\n<p>\u0412\u0441\u0451, \u0447\u0442\u043e\u00a0\u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u00a0PyTest \u043a\u043e\u0434\u0435\u00a0\u2014 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043d\u0430\u00a0\u043a\u0440\u0443\u0433\u043b\u044b\u0435. <code>[4, -1]<\/code> \u043d\u0430 <code>(4, -1)<\/code> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412\u00a0\u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0430 \u0448\u0435\u0441\u0442\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<pre><code class=\"python\"># test_quadratic.py import pytest from quadratic import quadratic_solve   @pytest.mark.parametrize(\"args, expected_result\", [     pytest.param((1, -3, -4), (4, -1), id=\"two roots\",),     pytest.param((1, -2, 1), (1.0, None), id=\"single root\",),     pytest.param((0, 0, 0), (None, None), id=\"no roots\",) ])  def test_solution(args, expected_result):     res = quadratic_solve(*args)     assert res == expected_result<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3.1 RobotFramework<\/h3>\n<p>\u0420\u043e\u0431\u043e\u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043a<a href=\"https:\/\/testsetup.ru\/robot\/collections\/tuple\/\"> \u043a\u043e\u0440\u0442\u0435\u0436\u0430\u043c.<\/a><\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432\u0430. \u0412\u00a0\u0441\u0443\u043c\u043c\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0441\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"python\">*** Settings ***  Library  ..\/..\/quadratic.py  Test Template    Verify Solution Suite Setup    Prepare Variables   *** Variables *** @{roots1}=    ${4.0}    ${-1.0} @{roots2}=    ${1.0}    ${None} @{roots3}=    ${None}    ${None}   *** Test Cases ***    a       b        c        expected_result Two Roots             ${1}    ${-3}    ${-4}    ${ex_res1} Single Root           ${1}    ${-2}    ${1}     ${ex_res2} No Roots              ${0}    ${0}     ${0}     ${ex_res3}   *** Keywords *** Verify Solution     [Arguments]    ${a}    ${b}    ${c}    ${expected}     ${res}=    Quadratic Solve    ${a}    ${b}    ${c}     Should Be Equal     ${res}    ${expected}   Convert List To Tuple     [Arguments]    ${list}     ${tuple}=    Evaluate    tuple(${list})     RETURN    ${tuple}   Prepare Variables     ${tup1}=   Convert List To Tuple    ${roots1}     ${tup2}=   Convert List To Tuple    ${roots2}     ${tup3}=   Convert List To Tuple    ${roots3}     Set Suite Variable    ${ex_res1}    ${tup1}     Set Suite Variable    ${ex_res2}    ${tup2}     Set Suite Variable    ${ex_res3}    ${tup3}<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u00a0\u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e\u00a0\u0443\u0436\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c PyTest \u043f\u0440\u0438\u00a0\u0441\u043c\u0435\u043d\u0435 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u00a0\u2014 \u0432\u00a0\u043d\u0451\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. PyTest \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u00a0\u044d\u0442\u0438\u043c \u043b\u0435\u0433\u043a\u043e. \u0410\u00a0\u0432\u043e\u0442 \u0440\u043e\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u044c, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0437\u0434\u0435\u0441\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043b\u0430\u0431\u0438\u0442\u044c\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/855\/e98\/512\/855e98512cda4f0e6e937e932be5578d.jpeg\" width=\"1280\" height=\"720\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/855\/e98\/512\/855e98512cda4f0e6e937e932be5578d.jpeg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/855\/e98\/512\/855e98512cda4f0e6e937e932be5578d.jpeg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 4. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/h2>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>get_digits()<\/strong> \u0438\u0437\u00a0\u043c\u043e\u0434\u0443\u043b\u044f <strong>list_of_digits.py<\/strong> \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0446\u0438\u0444\u0440.<\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b.<\/p>\n<p>\u0426\u0438\u0444\u0440\u044b \u044d\u0442\u043e <code>0, 1, 2\u2026 9<\/code>.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u00a0\u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u043d\u043e\u00a0\u0435\u0451 \u043d\u0435\u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c.<\/p>\n<p>\u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430\u00a0\u0442\u043e, \u0447\u0442\u043e\u00a0\u043c\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u043f\u0438\u0441\u043a\u0430 <strong>\u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/strong>.<\/p>\n<p>\u0421\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e PyTest \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u043e\u0432. \u0410\u00a0\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435. \u041a\u0430\u043a\u00a0\u0432\u00a0\u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>list_of_digits\/  \u251c\u2500\u2500 list_of_digits.py  \u251c\u2500\u2500 tests  \u2502   \u251c\u2500\u2500 pytest  \u2502   \u2502   \u2514\u2500\u2500 test_list_of_digits.py  \u2502   \u2514\u2500\u2500 robot  \u2502       \u2514\u2500\u2500 test_list_of_digits.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<pre><code class=\"python\"># list_of_digits.py import random  def get_digits() -&gt; list:     n = random.randint(1, 10)     result = []     for i in range(0, n):         result.append(random.randint(4, 10))     return result<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u00a0\u0431\u044b\u043b \u0432\u0435\u0441\u0435\u043b\u0435\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u0427\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u043d\u0441\u043e\u0432 \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0431\u0430\u0433.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 4. PyTest<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\"># test_list_of_digits.py import pytest import random from list_of_digits import get_digits   digits = get_digits()  @pytest.mark.parametrize(\"digit\", digits) def test_if_digit(digit):     assert 0 &lt;= digit &lt; 10<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u0438\u0437\u00a0\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>list_of_digits<\/strong> \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u043e\u043a\u0430 \u043d\u0435\u00a0\u043f\u043e\u0439\u043c\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<pre><code class=\"python\">python -m pytest -v --no-header .\\tests\\pytest\\test_list_of_digits.py<\/code><\/pre>\n<pre><code class=\"python\">=============== test session starts ===============  collected 2 items  tests\/pytest\/test_list_of_digits.py::test_if_digit[8] PASSED [ 50%] tests\/pytest\/test_list_of_digits.py::test_if_digit[7] PASSED [100%] ================ 2 passed in 0.01s ================  =============== test session starts ===============  collected 10 items tests\/pytest\/test_list_of_digits.py::test_if_digit[9_0] PASSED [ 10%] tests\/pytest\/test_list_of_digits.py::test_if_digit[4] PASSED [ 20%] tests\/pytest\/test_list_of_digits.py::test_if_digit[7] PASSED [ 30%] tests\/pytest\/test_list_of_digits.py::test_if_digit[8_0] PASSED [ 40%] tests\/pytest\/test_list_of_digits.py::test_if_digit[9_1] PASSED [ 50%] tests\/pytest\/test_list_of_digits.py::test_if_digit[8_1] PASSED [ 60%] tests\/pytest\/test_list_of_digits.py::test_if_digit[6_0] PASSED [ 70%] tests\/pytest\/test_list_of_digits.py::test_if_digit[8_2] PASSED [ 80%]  tests\/pytest\/test_list_of_digits.py::test_if_digit[10] FAILED [ 90%] tests\/pytest\/test_list_of_digits.py::test_if_digit[6_1] PASSED [100%] ===================== FAILURES =====================<\/code><\/pre>\n<p>\u0412\u00a0\u043f\u0435\u0440\u0432\u043e\u043c \u0442\u0435\u0441\u0442\u2011\u0440\u0430\u043d\u0435\u00a0\u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0415\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u00a0\u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <code>@pytest.mark.parametrize<\/code> \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u00a0\u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u0430\u043a\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 <code>PASSED<\/code>.<\/p>\n<p>\u0412\u043e\u00a0\u0432\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0441\u0442\u2011\u0440\u0430\u043d\u0435 \u0441\u043f\u0438\u0441\u043e\u043a\u00a0\u0431\u044b\u043b \u0443\u0436\u0435 \u0438\u0437\u00a0\u0434\u0435\u0441\u044f\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u0437\u00a0\u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u0414\u0435\u0432\u044f\u0442\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0430\u0432\u0435\u043d 10, \u0430\u00a0\u044d\u0442\u043e \u043d\u0435\u00a0\u0446\u0438\u0444\u0440\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0441\u0442 \u0443\u043f\u0430\u043b.<\/p>\n<p>\u0418\u0437\u00a0\u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e\u00a0PyTest \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u00a0\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440.<\/p>\n<pre><code class=\"python\">@pytest.mark.parametrize(\"digit\", digits)<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0445\u043e\u0442\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u00a0\u0441\u0442\u0440\u043e\u043a\u0430\u00a0\u2014 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u00a0\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e<u> <\/u>\u043f\u043e\u00a0\u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443.<\/p>\n<p>\u042f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u00a0\u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u00a0\u0441\u043f\u0438\u0441\u043a\u0443.<\/p>\n<p>\u0411\u0435\u0437\u00a0PyTest \u043c\u044b \u043c\u043e\u0433\u043b\u0438\u00a0\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443:<\/p>\n<pre><code class=\"python\">for digit in digits:     assert 0 &lt;= digit &lt;= 9, f\"{digit} is not a digit\"<\/code><\/pre>\n<p>\u041d\u043e\u00a0\u043e\u043d\u0430\u00a0\u0431\u044b \u043f\u0430\u0434\u0430\u043b\u0430 \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435 \u0430\u00a0\u0441\u00a0PyTest \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0432\u0441\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 4. RobotFramework<\/h3>\n<p>\u041a\u0430\u043a\u00a0\u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u00a0\u0440\u043e\u0431\u043e\u0442\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DataDriver.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a <strong>.csv<\/strong> \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e DataDriver \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u00a0\u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0432\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0440\u043e\u0431\u043e\u0442\u0430 \u043e\u043d \u043d\u0435\u00a0\u0432\u0445\u043e\u0434\u0438\u0442.<\/p>\n<pre><code class=\"bash\">python -m pip install robotframework-datadriver<\/code><\/pre>\n<p>\u0414\u043b\u044f\u00a0\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 .csv \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e .py \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043d\u0430\u00a0\u0447\u0438\u0441\u0442\u043e\u043c \u0440\u043e\u0431\u043e\u0442\u0435. \u041d\u043e\u00a0\u0441\u0443\u0442\u044c \u043d\u0435\u00a0\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f\u00a0\u2014 \u043c\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u00a0\u043d\u0430\u0448 \u0442\u0435\u0441\u0442.<\/p>\n<pre><code>list_of_digits\/  \u251c\u2500\u2500 list_of_digits.py  \u251c\u2500\u2500 tests  \u2502   \u251c\u2500\u2500 pytest  \u2502   \u2502   \u2514\u2500\u2500 test_list_of_digits.py  \u2502   \u2514\u2500\u2500 robot  \u2502       \u251c\u2500\u2500 libraries  \u2502       \u2502   \u2514\u2500\u2500 save_to_csv.py  \u2502       \u2514\u2500\u2500 test_list_of_digits.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u0430 \u0440\u044f\u0434\u043e\u043c \u0441 <strong>list_of_digits.py <\/strong>\u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b <strong>UserData.csv<\/strong><\/p>\n<pre><code class=\"python\"># save_to_csv.py def save_list_to_csv(list_of_digits):     with open(\"UserData.csv\", \"w\") as f:         f.write(\"*** Test Cases ***;${var}\")     i = 0     for digit in list_of_digits:         i += 1         with open(\"UserData.csv\", \"a\") as f:             f.writelines(\"\\n\")             f.writelines(\"Test-\" + str(i) + \". Digit: \" + str(digit))             f.writelines(\";\")             f.writelines(str(digit))<\/code><\/pre>\n<pre><code class=\"python\"># test_list_of_digits.py *** Settings *** Library  DataDriver    ..\/..\/UserData.csv Library  ..\/..\/list_of_digits.py Library  libraries\/save_to_csv.py  Suite Setup    Prepare Variables  Test Template    Variable Is Digit  *** Test Cases *** Test    ${var}  *** Keywords *** Prepare Variables     ${list_of_digits}=    Get Digits     Save List To Csv    ${list_of_digits}  Variable Is Digit     [Arguments]    ${var}     ${num}=  Convert To Integer    ${var}     Should Be True    ${num} &gt;= 0     Should Be True    ${num} &lt; 10<\/code><\/pre>\n<pre><code class=\"python\">python -m robot .\\tests\\robot\\test_list_of_digits.robot<\/code><\/pre>\n<pre><code class=\"python\">======================================================================== ====== Test List Of Digits ======================================================================== ====== Test-1. Digit: 9 | PASS | ------------------------------------------------------------------------ ------ Test-2. Digit: 4 | PASS | ------------------------------------------------------------------------ ------ Test-3. Digit: 7 | PASS | ------------------------------------------------------------------------ ------ Test-4. Digit: 7 | PASS | ------------------------------------------------------------------------ ------ Test List Of Digits | PASS | 4 tests, 4 passed, 0 failed ========================================================================<\/code><\/pre>\n<pre><code class=\"python\">======================================================================== ====== Test List Of Digits ======================================================================== ====== Test-1. Digit: 8 | PASS | ------------------------------------------------------------------------ ------ Test-2. Digit: 10 | FAIL | '10 &lt; 10' should be true. ------------------------------------------------------------------------ ------ Test-3. Digit: 1 | PASS | ------------------------------------------------------------------------ ------ Test List Of Digits | FAIL | 3 tests, 2 passed, 1 failed ========================================================================<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0422\u0435\u0441\u0442-\u0440\u0430\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u043b \u0438\u0437\u00a0\u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0442\u0435\u0441\u0442\u2011\u043a\u0435\u0439\u0441\u043e\u0432 \u0438 \u043d\u0435\u00a0\u0441\u043c\u043e\u0433 \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443. \u0412\u0442\u043e\u0440\u043e\u0439 \u0442\u0435\u0441\u0442\u2011\u0440\u0430\u043d \u0445\u043e\u0442\u044f \u0438\u00a0\u0431\u044b\u043b \u043a\u043e\u0440\u043e\u0447\u0435, \u043d\u043e\u00a0\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0443\u0434\u0430\u0447\u043b\u0438\u0432\u0435\u0435 \u0438 \u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0435 \u0447\u0438\u0441\u043b\u043e\u00a0\u0431\u044b\u043b\u043e \u043d\u0435\u00a0\u0446\u0438\u0444\u0440\u043e\u0439.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434 \u043e\u00a0\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439: \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u00a0\u0440\u043e\u0431\u043e\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u043d\u043e\u00a0\u044d\u0442\u043e \u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0446\u0435\u043d\u043e\u0439.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u00a0\u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 5. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0430\u0439\u0442\u0430<\/h2>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0441\u0430\u0439\u0442\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0435\u00a0\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u0430\u0439\u0442\u0430<a href=\"https:\/\/testsetup.ru\/\"> <\/a><a href=\"http:\/\/testsetup.ru\"><u>testsetup.ru<\/u><\/a> \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 HTTP \u043a\u043e\u0434\u043e\u043c 200.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">from_site_map\/  \u251c\u2500\u2500 app  \u2502   \u251c\u2500\u2500 site_map.py  \u2502   \u2514\u2500\u2500 tests  \u2502       \u251c\u2500\u2500 pytest  \u2502       \u2502   \u2514\u2500\u2500 test_by_site_map.py  \u2502       \u2514\u2500\u2500 robot  \u2502           \u251c\u2500\u2500 libraries  \u2502           \u2502 \u2514\u2500\u2500 save_to_csv.py  \u2502           \u2514\u2500\u2500 test_by_site_map.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<p>\u041d\u0430\u00a0\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430\u0445<a href=\"https:\/\/cp.beget.com\/cloudservices\/sitemap\"> <\/a>\u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e: \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438\u043b\u0438\u00a0\u043d\u0430\u00a0\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u0441\u0430\u0439\u0442\u0435.<\/p>\n<p>C\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0451 \u0432\u00a0\u0442\u0443\u00a0\u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 <strong>site_map.py:<\/strong><\/p>\n<pre><code>from_site_map\/  \u251c\u2500\u2500 app  \u2502   \u251c\u2500\u2500 site_map.py  \u2502   \u251c\u2500\u2500 sitemap.xml  \u2502   \u2514\u2500\u2500 tests  \u2502       \u251c\u2500\u2500 pytest  \u2502       \u2502   \u2514\u2500\u2500 test_by_site_map.py  \u2502       \u2514\u2500\u2500 robot  \u2502           \u251c\u2500\u2500 libraries  \u2502           \u2502   \u2514\u2500\u2500 save_to_csv.py  \u2502           \u2514\u2500\u2500 test_by_site_map.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;  &lt;url&gt;    &lt;loc&gt;https:\/\/testsetup.ru\/pytest\/&lt;\/loc&gt;    &lt;priority&gt;0.8&lt;\/priority&gt;    &lt;changefreq&gt;daily&lt;\/changefreq&gt;  &lt;\/url&gt;  &lt;url&gt;    &lt;loc&gt;https:\/\/testsetup.ru\/robot\/&lt;\/loc&gt;    &lt;priority&gt;0.6&lt;\/priority&gt;    &lt;changefreq&gt;daily&lt;\/changefreq&gt;  &lt;\/url&gt; &lt;\/urlset&gt;<\/code><\/pre>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0442\u0430\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u00a0\u0442\u0435\u0441\u0442\u0430\u043c.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 5. PyTest<\/h3>\n<p>\u0414\u043b\u044f\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>xmlschema<\/strong> \u0430\u00a0\u0434\u043b\u044f\u00a0\u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u00a0\u0441\u0430\u0439\u0442\u0443\u00a0\u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>requests.<\/strong><\/p>\n<pre><code class=\"python\"># site_map.py import xml.etree.ElementTree as ET   def get_urls() -&gt; list:     tree = ET.parse(\"sitemap.xml\")     root = tree.getroot()      urls = []      for child in root:         for gc in child:             tag = gc.tag             if \"loc\" in tag:                 urls.append(gc.text)      return urls<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c. \u0417\u0430\u00a0\u044d\u0442\u043e \u043c\u044b \u0438 \u043b\u044e\u0431\u0438\u043c PyTest.<\/p>\n<pre><code class=\"python\"># test_by_site_map.py import pytest import requests from site_map import get_urls   endpoints = get_urls()  @pytest.mark.parametrize('endpoint', endpoints) def test_status(endpoint):     r = requests.get(endpoint, allow_redirects=False)     assert r.status_code == 200<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">python -m pytest -v --no-header tests\\pytest\\test_by_site_map.py<\/code><\/pre>\n<pre><code>tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/auto\/] PASSED [ 0%] tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/theory\/] PASSED [ 0%] tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/robot\/] PASSED [ 0%] tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/pytest\/] PASSED [ 1%] tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/testcomplete\/] PASSED [ 1%] ... tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/edu\/ PASSED [ 99%] tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/selenium\/] PASSED [100%] =================================== 553 passed in 121.11s (0:02:01) ====================================<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 5. RobotFramework<\/h3>\n<p>\u0414\u043b\u044f\u00a0\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043a\u0430\u0440\u0442\u044b \u0441\u0430\u0439\u0442\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>XML<\/strong> \u0430\u00a0\u0434\u043b\u044f\u00a0\u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u00a0\u0441\u0430\u0439\u0442\u0443\u00a0\u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>RequestsLibrary.<\/strong><\/p>\n<pre><code class=\"python\">*** Settings *** Library    XML Library    RequestsLibrary Library    Collections Library    DataDriver    ..\/..\/Urls.csv Library    libraries\/save_to_csv.py  Suite Setup    Prepare Variables Test Template    Status Is OK  *** Variables *** ${XML}=    sitemap.xml @{urls}  *** Test Cases *** Test ${url}  *** Keywords *** Prepare Variables     ${urls}=    Get Urls     Save List To Csv    ${urls}  Status Is OK     [Arguments]    ${url}     ${response}=    GET    ${url}    expected_status=200    allow_redirects=${False}  Get Urls     @{children} =   Get Elements  ${XML}  *\/loc     FOR     ${child}    IN   @{children}         Append To List    ${urls}    ${child.text}     END     RETURN    ${urls}<\/code><\/pre>\n<pre><code class=\"python\"># save_to_csv.py def save_list_to_csv(list_of_urls, file_name=\"Urls.csv\"):     with open(file_name, \"w\") as f:         f.write(\"*** Test Cases ***;${url}\")     i = 0     for url in list_of_urls:         i += 1         with open(file_name, \"a\") as f:             f.writelines(\"\\n\")             f.writelines(\"Test-\" + str(i) + \". URL: \" + str(url))             f.writelines(\";\")             f.writelines(str(url))<\/code><\/pre>\n<pre><code class=\"bash\">python -m robot .\\tests\\robot\\test_site_map.robot<\/code><\/pre>\n<pre><code class=\"python\">======================================================================== ====== Test Site Map ======================================================================== ======  ------------------------------------------------------------------------ ------ Test-1. URL: https:\/\/testsetup.ru\/testcomplete\/ | PASS | ------------------------------------------------------------------------ ------ Test-2. URL: https:\/\/testsetup.ru\/edu\/ | PASS | ...  ------------------------------------------------------------------------ ------ Test Site Map | PASS | 553 tests, 553 passed, 0 failed ========================================================================<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0443, \u043e\u043d \u0443\u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e\u00a0\u043d\u0430\u00a0\u0432\u0445\u043e\u0434\u0435 \u0443\u00a0\u043d\u0430\u0441 <strong>sitemap.xml.<\/p>\n<p><\/strong>\u0410\u00a0\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/robot\/tags\/] PASSED [ 0%] ... tests\/pytest\/test_by_site_map.py::test_status[https:\/\/testsetup.ru\/selenium\/] PASSED [100%] ============================== 553 passed in 121.11s (0:02:01) ===============================<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432:<\/p>\n<pre><code class=\"python\">====== Test Site Map ======================================================================== ====== ------------------------------------------------------------------------ ------ Test-1. URL: https:\/\/testsetup.ru\/testcomplete\/ | PASS | ------------------------------------------------------------------------ ------ Test-2. URL: https:\/\/testsetup.ru\/edu\/ | PASS | ... ------------------------------------------------------------------------ ------ Test Site Map | PASS | 553 tests, 553 passed, 0 failed ========================================================================<\/code><\/pre>\n<h2>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>\u0415\u0441\u043b\u0438 Python \u043d\u0435\u00a0\u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u00a0\u043a\u043e\u0434\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432\u00a0\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u043f\u043e\u00a0\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a <strong>tests<\/strong>\u00a0\u2014 \u0432\u00a0\u043d\u0430\u0448\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e <strong>from_site_map<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0412\u00a0PowerShell \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"powershell\">$Env:Path += \";$pwd\"<\/code><\/pre>\n<p>\u0412\u00a0Bash \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u2011\u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<pre><code class=\"bash\">export PATH=$PATH:$(pwd)<\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Robot Framework \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0442\u0435\u0441\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u0423\u00a0\u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043b\u0443\u0447\u0448\u0435 \u0434\u043b\u044f\u00a0\u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u0412\u00a0\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 Robot Framework \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 PyTest \u0432\u00a0\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0438 \u0438\u0437\u044f\u0449\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0441\u0443\u0442\u044c, \u043f\u043e\u00a0\u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432\u00a0\u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043e\u043d \u0441\u0443\u043c\u0435\u043b. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Robot Framework \u043a\u00a0\u0442\u0430\u043a\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0430\u043c \u0438\u043b\u0438\u00a0\u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u00a0\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u0440\u043e\u00a0\u044d\u0442\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/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\/902456\/\"> https:\/\/habr.com\/ru\/articles\/902456\/<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \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: PyTest \u0438 RobotFramework.<\/p>\n<p>\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f<a href=\"https:\/\/habr.com\/ru\/companies\/maxilect\/articles\/521620\/\"> <u>\u0441\u0442\u0430\u0442\u044c\u044f<\/u><\/a> \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u042f \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0445\u0430\u0431\u0440-\u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e Robot Framework \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b &#171;\u043d\u0430 \u043b\u0435\u0442\u0443&#187; \u043a\u0430\u043a \u0432 PyTest. <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0442\u044c \u0438 \u043a\u0440\u0438\u0432\u043e, \u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 Robot Framework \u0438 PyTest \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c PyTest \u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441 \u043d\u0438\u043c \u0432\u0441\u0451 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0441\u043e\u0431\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 PyTest \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0442\u0435 \u0436\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f Robot Framework-y.<\/p>\n<h2>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0442\u0443\u0434\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e:\u00a0<\/p>\n<pre><code class=\"python\">\u0422\u0435\u0441\u04421 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(0, 0) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0 \u0422\u0435\u0441\u04422 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(-1, 1) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0 \u2026 \u0422\u0435\u0441\u04429 \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0442\u043e \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435(7, 8) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 15<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>alt<\/figcaption><\/div>\n<\/figure>\n<p>\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0434 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439\u0422\u0435\u0441\u0442((0, 0, 0), (-1, 1, 0), ... , (7, 8, 15))<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0439 \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/p>\n<blockquote>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0432 \u043e\u0434\u0438\u043d \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0435\u0441\u0442. \u0415\u0441\u043b\u0438 \u0431\u044b\u043b\u043e \u0434\u0435\u0432\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u0445 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0434\u0435\u0432\u044f\u0442\u044c, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u043b\u0438 \u043f\u0430\u0434\u0430\u0442\u044c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.  <\/p>\n<\/blockquote>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0443\u00a0\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0442\u043e\u043c \u043b\u0435\u0433\u0447\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u00a0\u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0434\u043b\u044f\u00a0\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u043e\u0432, \u0438\u0445 \u043f\u043e\u0432\u0442\u043e\u0440 \u043f\u043b\u043e\u0445\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a<a href=\"https:\/\/devhops.ru\/db\/\"> <\/a>\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u0441\u0442\u0430, \u0430\u00a0\u0432\u00a0\u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0447\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438\u00a0\u2014 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">python -m venv venv<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p> \u0412<a href=\"https:\/\/devhops.ru\/windows\/\"> <\/a>Windows \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"powershell\">.\\venv\\Scripts\\activate<\/code><\/pre>\n<p>\u0412\u00a0Linux\u00a0\u2014 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u2011\u0434\u0440\u0443\u0433\u043e\u043c\u0443:<\/p>\n<pre><code class=\"bash\">source .\/venv\/bin\/activate<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">python -m pip install pytest requests xmlschema robotframework robotframework-datadriver<\/code><\/pre>\n<p>\u041a\u0430\u043a\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437 <strong>requirements.txt<\/strong><\/p>\n<pre><code>pytest==8.3.5 requests==2.32.3 xmlschema==3.4.3 robotframework==7.2.2 robotframework-datadriver==1.11.22<\/code><\/pre>\n<pre><code class=\"bash\">python -m pip install -r requirements.txt<\/code><\/pre>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0437\u0430\u0431\u044b\u043b \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0422\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h2>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>filter_three()<\/strong> \u0438\u0437\u00a0\u043c\u043e\u0434\u0443\u043b\u044f <strong>three_digit.py<\/strong> \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <strong>True<\/strong> \u0435\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u043e\u0435.<\/p>\n<pre><code class=\"python\">def filter_three(x: int) -&gt; bool: return 100 &lt;= x &lt; 1000<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e PyTest \u0438 RF.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>filter_three\/\u00a0 \u251c\u2500\u2500 three_digit.py\u00a0 \u2514\u2500\u2500 tests\u00a0 \u00a0\u00a0\u00a0\u00a0\u251c\u2500\u2500 pytest \u00a0\u00a0\u00a0\u00a0| \u00a0 \u2514\u2500\u2500 test_filter_three.py \u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500 robot\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500 test_filter_three.robot<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>filter_three()<\/strong> \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u00a0\u043d\u0435\u0435 \u043a\u0430\u043a\u00a0\u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435\u00a0\u0442\u0440\u0451\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u0421\u00a0\u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0430\u043a\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. PyTest<\/h3>\n<p>\u041d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u00a0\u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"python\">[      (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     (\u0427\u0438\u0441\u043b\u043e, \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442) ]<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432. \u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0445 \u0448\u0435\u0441\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u00a0\u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043c, \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0438\u0445 <strong>test_input<\/strong> \u0438 <strong>expected_result<\/strong><\/p>\n<pre><code class=\"python\">import pytest from three_digit import filter_three   @pytest.mark.parametrize(\"test_input, expected_result\", [     (8, False),     (99, False),     (100, True),     (101, True),     (999, True),     (1000, False) ])  def test_compare(test_input, expected_result):     res = filter_three(test_input)     assert res == expected_result<\/code><\/pre>\n<pre><code class=\"bash\">python -m pytest -v --no-header .\\tests\\pytest\\test_filter_three.py<\/code><\/pre>\n<pre><code class=\"python\">======================== test session starts ========================== collected 6 items tests\/pytest\/test_filter_three.py::test_compare[9-False] PASSED [ 16%] tests\/pytest\/test_filter_three.py::test_compare[99-False] PASSED [ 33%] tests\/pytest\/test_filter_three.py::test_compare[100-True] PASSED [ 50%] tests\/pytest\/test_filter_three.py::test_compare[101-True] PASSED [ 66%] tests\/pytest\/test_filter_three.py::test_compare[999-True] PASSED [ 83%] tests\/pytest\/test_filter_three.py::test_compare[1000-False] PASSED [100%] ========================= 6 passed in 0.02s ===========================<\/code><\/pre>\n<p>\u0414\u043b\u044f\u00a0\u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>pytest.param id=<\/strong><\/p>\n<p>\u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u00a0\u0440\u043e\u0431\u043e\u0442\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0451\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u00a0\u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<pre><code class=\"python\">import pytest from three_digit import filter_three   @pytest.mark.parametrize(\"test_input, expected_result\", [     pytest.param(8, False, id=\"Digit\"),     pytest.param(99, False, id=\"Two Digit Number\"),     pytest.param(100, True, id=\"Lower Border\"),     pytest.param(101, True, id=\"Three Digit Number\"),     pytest.param(999, True, id=\"Upper Border\"),     pytest.param(1000, False, id=\"Four Digit Number\") ])  def test_compare(test_input, expected_result):     res = filter_three(test_input)     assert res == expected_result<\/code><\/pre>\n<pre><code class=\"python\">======================== test session starts ========================== collected 6 items  tests\/pytest\/test_filter_three.py::test_compare[Digit] PASSED [ 16%] tests\/pytest\/test_filter_three.py::test_compare[Two Digit Number] PASSED [ 33%] tests\/pytest\/test_filter_three.py::test_compare[Lower Border] PASSED [ 50%] tests\/pytest\/test_filter_three.py::test_compare[Three Digit Number] PASSED [ 66%] tests\/pytest\/test_filter_three.py::test_compare[Upper Border] PASSED [ 83%] tests\/pytest\/test_filter_three.py::test_compare[Four Digit Number] PASSED [100%] ========================= 6 passed in 0.02s ===========================<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. Robot Framework<\/h3>\n<p>\u0412\u00a0Robot Framework \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<pre><code class=\"python\">*** Settings ***  Library  ..\/..\/three_digit.py  Test Template    Validate Number  *** Test Cases ***    number    expected_result Digit                 8         ${False} Two Digit Number      99        ${False} Lower Border          100       ${True} Three Digit Number    101       ${True} Upper Border          999       ${True} Four Digit Number     1000      ${False}  *** Keywords *** Validate Number    [Arguments]    ${number}    ${expected}    ${res}=    Filter Three    ${number}    Should Be Equal     ${res}    ${expected}<\/code><\/pre>\n<pre><code class=\"bash\">python -m robot .\\tests\\robot\\test_filter_three.robot<\/code><\/pre>\n<pre><code class=\"python\">======================================================================== ====== Test Filter Three  ======================================================================== ====== Digit | PASS | ------------------------------------------------------------------------ ------ Two Digit Number | PASS | ------------------------------------------------------------------------ ------ Lower Border | PASS | ------------------------------------------------------------------------ ------ Three Digit Number | PASS | ------------------------------------------------------------------------ ------ Upper Border | PASS | ------------------------------------------------------------------------ ------ Four Digit Number | PASS | ------------------------------------------------------------------------ ------ Test Filter Three | PASS | 6 tests, 6 passed, 0 failed ========================================================================<\/code><\/pre>\n<p>\u0412\u00a0\u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u043d\u0435\u00a0\u0432\u044b\u044f\u0432\u043b\u0435\u043d\u043e.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u00a0\u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u043d\u0435\u00a0\u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u00a0\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u0435\u0441\u0442. \u0418\u0437\u0443\u0447\u0430\u044f \u0441\u043f\u0435\u0440\u0432\u0430 \u041f\u0440\u0438\u043c\u0435\u0440 1\u00a0\u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u041f\u0440\u0438\u043c\u0435\u0440 2\u00a0\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e, \u043d\u0435\u00a0\u0437\u043d\u0430\u043a\u043e\u043c\u043e\u043c\u0443 \u0441\u00a0PyTest, \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u00a0\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0PyTest \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>parametrize\/  \u251c\u2500\u2500 prod  \u2502 \u251c\u2500\u2500 prod.py  \u2502 \u2514\u2500\u2500 tests  \u2502     \u251c\u2500\u2500 pytest  \u2502     \u2502   \u2514\u2500\u2500 test_prod.py  \u2502     \u2514\u2500\u2500 robot  \u2502         \u2514\u2500\u2500 test_prod.robot  \u2514\u2500\u2500 venv<\/code><\/pre>\n<pre><code class=\"python\"># prod.py def prod(a, b):     return a * b<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. PyTest<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439. \u0412\u00a0\u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u0440\u0442\u0435\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u043e \u043a\u043e\u0440\u0442\u0435\u0436 \u0438\u0437\u00a0\u0434\u0432\u0443\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0412\u0442\u043e\u0440\u043e\u0439\u00a0\u2014 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u00a0\u0444\u043e\u0440\u043c\u0430\u0442\u0435 int.<\/p>\n<pre><code class=\"python\">[      ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442),     ((\u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c, \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c), \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442) ]<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u043d\u0430\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0443, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0440\u0442\u0435\u0436\u0430 \u0441\u00a0\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/devhops.ru\/code\/python\/functions\/args_kwargs\/\"> *args<\/a>.<\/p>\n<pre><code class=\"python\"># test_prod.py import pytest from prod import prod   @pytest.mark.parametrize(     \"args, expected_result\",     [        pytest.param((0, 0), 0, id=\"zero - zero\"),         pytest.param((7, -8), -56, id=\"positive - negative\"),        pytest.param((13.0, 14), 182, id=\"float positive - positive\"),     ])  def test_param_prod(args, expected_result):     res = prod(*args)     assert res == expected_result<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u00a0\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>prod<\/strong> \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<pre><code class=\"bash\">python -m pytest -v --no-header .\\tests\\pytest\\<\/code><\/pre>\n<pre><code class=\"python\">====================== test session starts ====================== collected 3 items tests\/pytest\/test_prod.py::test_basic_param_prod[zero - zero] PASSED [ 33%] tests\/pytest\/test_prod.py::test_basic_param_prod[positive - negative] PASSED [ 66%] tests\/pytest\/test_prod.py::test_basic_param_prod[float positive - positive] PASSED [100%]  ==================== 3 passed in 0.01s =========================<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. Robot Framework<\/h3>\n<pre><code class=\"python\">*** Settings ***  Library  ..\/..\/prod.py Test Template    Validate Prod  *** Test Cases ***         arg1       arg2     expected_result Zero Zero                  ${0}       ${0}     ${0} Positive Negative          ${7}       ${-8}    ${-56} Float Positive Positive    ${13.0}    ${14}    <\/code><\/pre>\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-463254","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463254","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=463254"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463254\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}