RUVIDEO
Поделитесь видео 🙏

How To Group Pytests In Python (2 Min)

📁 Обучение 👁️ 16 📅 02.12.2023

In this tutorial, you'll learn how to group Pytest tests in Python to execute a subset of tests.


Facebook: https://www.facebook.com/GokceDBsql

Video Transcript:

Connect MySQL In Python: https://www.youtube.com/watch?v=0qBctY82et0

Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn how to group tests together in Python using the PI test. Let's start by looking at the tests folder.

I have three test files right now and each test file contains two tests. In the first file for the cache sales report, I have two tests and in both tests, I'm asserting whether the select keyword appears in the query or not. Note, I'm using the AT PI test decorator and I'm marking the first test using the marker name of the first underscore query and the second test with the marker of the second underscore query.

I'm using the same marker names for the tests defined in the customer report file and the lead report file. In the customer report file, I'm expecting the second query test to fail because I know XYZ doesn't exist in the second query. To execute the test, right-click on the test folder and hit run the PI test.

As expected all six tests were executed and only one test failed. Now say I only want to execute all the tests with the marker name of the first underscore query. To do that click on the PI test dropdown and click on edit configuration.

In the additional arguments section, type the hyphen m arguments section first underscore query then hit ok. Now if you rerun the tests you'll notice that only three out of the six tests were executed. Similarly, if you just wanted to run tests with the marker name of the second underscore query, you'll change the additional argument with the appropriate marker name another way to specify the PI test.ini file in the PI test section.

Just write add opt equal to hyphen m followed by the marker name. Finally to export the test results click on the export test results button. There you have it.

Make sure you like, subscribe, and turn on the notification bell. Until next time.

[pytest]
addopts = ''-m first_query"

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How To Group Pytests In Python (2 Min)», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.