title
PyTest Tutorial | Unit Testing Framework In Python | How to use PyTest | Python Training | Edureka

description
🔥Edureka Python Certification Training: https://www.edureka.co/python-programming-certification-training This Edureka video on 'Pytest' will help you understand how we can write simple tests in python with a use case for testing an API. Following are the topics discussed: What is Pytest? Getting Started With Pytest Create Your First Test With Pytest Multiple Tests Grouping Multiple Tests Pytest Fixtures Parameterized Tests Testing An API Using Pytest 🔹Python Tutorial Playlist: https://goo.gl/WsBpKe 🔹Blog Series: http://bit.ly/2sqmP4s Do subscribe to our channel and hit the bell icon to never miss an update from us in the future: https://goo.gl/6ohpTV ---------------------------------------------------------------------------------------------------------------------------------- Instagram: https://www.instagram.com/edureka_learning/ Facebook: https://www.facebook.com/edurekaIN/ Twitter: https://twitter.com/edurekain LinkedIn: https://www.linkedin.com/company/edureka SlideShare: https://www.slideshare.net/EdurekaIN #Edureka #PythonEdureka #pytest #pythonprojects #pythonprogramming #pythontutorial #PythonTraining ----------------------------------------------------------------------------------------------------------------------------------- How does it work? 1. This is a 5 Week Instructor-led Online Course,40 hours of assignment and 20 hours of project work 2. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course. 3. At the end of the training, you will be working on a real-time project for which we will provide you a Grade and a Verifiable Certificate! ----------------------------------------------------------------------------------------------------------------------------------- About the Course Edureka's Python Online Certification Training will make you an expert in Python programming. It will also help you learn Python the Big data way with integration of Machine learning, Pig, Hive, and Web Scraping through beautiful soup. During our Python Certification training, our instructors will help you: 1. Master the Basic and Advanced Concepts of Python 2. Understand Python Scripts on UNIX/Windows, Python Editors, and IDEs 3. Master the Concepts of Sequences and File operations 4. Learn how to use and create functions, sorting different elements, Lambda function, error handling techniques, and Regular expressions and using modules in Python 5. Gain expertise in machine learning using Python and build a Real-Life Machine Learning application 6. Understand the supervised and unsupervised learning and concepts of Scikit-Learn 7. Master the concepts of MapReduce in Hadoop 8. Learn to write Complex MapReduce programs 9. Understand what is PIG and HIVE, Streaming feature in Hadoop, MapReduce job running with Python 10. Implementing a PIG UDF in Python, Writing a HIVE UDF in Python, Pydoop and/Or MRjob Basics 11. Master the concepts of Web scraping in Python 12. Work on a Real Life Project on Big Data Analytics using Python and gain Hands-on Project Experience ----------------------------------------------------------------------------------------------------------------------------------- Why learn Python? Programmers love Python because of how fast and easy it is to use. Python cuts development time in half with its simple to read syntax and easy compilation feature. Debugging your programs is a breeze in Python with its built-in debugger. Using Python makes Programmers more productive and their programs ultimately better. Python continues to be a favorite option for data scientists who use it for building and using Machine learning applications and other scientific computations. Python runs on Windows, Linux/Unix, Mac OS and has been ported to Java and .NET virtual machines. Python is free to use, even for commercial products, because of its OSI-approved open source license. Python has evolved as the most preferred Language for Data Analytics and the increasing search trends on python also indicates that Python is the next "Big Thing" and a must for Professionals in the Data Analytics domain. ----------------------------------------------------------------------------------------------------------------------------------- Who should go for python? The Python Programming Certification Course is a good fit for the below professionals: Programmers, Developers, Technical Leads, Architects, Freshers Data Scientists, Data Analysts Statisticians and Analysts Business Analysts Project Managers Business Intelligence Managers For more information, please write back to us at sales@edureka.in or call us at IND: 9606058406 / US: 18338555775

detail
{'title': 'PyTest Tutorial | Unit Testing Framework In Python | How to use PyTest | Python Training | Edureka', 'heatmap': [{'end': 158.8, 'start': 134.563, 'weight': 0.713}, {'end': 240.925, 'start': 204.796, 'weight': 0.746}, {'end': 428.372, 'start': 359.741, 'weight': 0.796}, {'end': 493.479, 'start': 458.252, 'weight': 0.746}, {'end': 593.134, 'start': 546.624, 'weight': 0.956}, {'end': 761.888, 'start': 732.067, 'weight': 0.709}], 'summary': 'This tutorial covers pi test, open source with parallel test running and easy installation, writing and running tests, using assert keyword, running multiple tests, fixture implementation, test cases creation, running pytest with 1 failed and 2 passed tests, parameterizing tests, api testing with pytest framework, and testing login requests with successful test cases.', 'chapters': [{'end': 177.496, 'segs': [{'end': 55.542, 'src': 'embed', 'start': 29.233, 'weight': 2, 'content': [{'end': 36.376, 'text': 'We will make the first test with pi test and then we will take a look at multiple tests and grouping them together into a class,', 'start': 29.233, 'duration': 7.143}, {'end': 44.098, 'text': "and then we'll be taking a look at parameterize test and we'll be taking a look at assertions how to run multiple tests and python fixtures,", 'start': 36.376, 'duration': 7.722}, {'end': 45.639, 'text': 'parameterize test, Etc.', 'start': 44.098, 'duration': 1.541}, {'end': 47.999, 'text': 'So I hope you guys are clear with the agenda.', 'start': 46.419, 'duration': 1.58}, {'end': 55.542, 'text': "Also, don't forget to subscribe to edureka for more exciting tutorials and press the bell icon to get the latest updates on edureka.", 'start': 48.66, 'duration': 6.882}], 'summary': 'Testing includes pi test, multiple tests, parameterize test, and assertions. subscribe to edureka for more tutorials.', 'duration': 26.309, 'max_score': 29.233, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I29233.jpg'}, {'end': 96.442, 'src': 'embed', 'start': 70.495, 'weight': 0, 'content': [{'end': 79.579, 'text': 'The pi test framework makes it easy to write small test, yet scales to support complex functional testing for applications and libraries.', 'start': 70.495, 'duration': 9.084}, {'end': 84.982, 'text': 'pi test is a mature, full-featured python testing tool that helps you write better programs.', 'start': 79.579, 'duration': 5.403}, {'end': 94.48, 'text': 'Some of the advantages of using pi test are it is open source first of all, and it can skip test also automatically detect the test.', 'start': 85.791, 'duration': 8.689}, {'end': 96.442, 'text': 'We can run tests in parallel.', 'start': 94.88, 'duration': 1.562}], 'summary': 'Pi test framework: supports small to complex testing, open source, detects and skips tests, allows parallel testing', 'duration': 25.947, 'max_score': 70.495, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I70495.jpg'}, {'end': 158.8, 'src': 'heatmap', 'start': 134.563, 'weight': 0.713, 'content': [{'end': 143.194, 'text': "So let us go to pi charm guys, right? So I'll just delete this So the project dependencies in this program are very few.", 'start': 134.563, 'duration': 8.631}, {'end': 147.676, 'text': 'So first of all, you have to make sure you have installed by test on your project.', 'start': 143.795, 'duration': 3.881}, {'end': 153.899, 'text': 'So here you can just type by test.', 'start': 151.057, 'duration': 2.842}, {'end': 158.8, 'text': 'you can see by test simple, powerful testing with python, and the authors are Holger crackle,', 'start': 153.899, 'duration': 4.901}], 'summary': 'Few project dependencies, ensure by test is installed. powerful testing with python by holger crackle.', 'duration': 24.237, 'max_score': 134.563, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I134563.jpg'}], 'start': 11.38, 'title': 'Introduction to pi test in python', 'summary': 'Introduces pi test in python, highlighting its open source nature, ability to run tests in parallel, and ease of installation. it also covers the agenda for the session, including making the first test with pi test, multiple tests and grouping them, parameterized tests, and assertions.', 'chapters': [{'end': 177.496, 'start': 11.38, 'title': 'Introduction to pi test in python', 'summary': 'Introduces pi test in python, covering its advantages like open source nature, ability to run tests in parallel, and ease of installation, and discusses the agenda for the session, including making the first test with pi test, multiple tests and grouping them, parameterized tests, and assertions.', 'duration': 166.116, 'highlights': ['Pi test framework makes it easy to write small tests and supports complex functional testing for applications and libraries, and it is open source. The Pi test framework allows for writing small tests and supports complex functional testing for applications and libraries. It is open source.', "Advantages of using Pi Test include the ability to run tests in parallel and easy installation by running a simple command 'pip install pytest'. Advantages of using Pi Test include the ability to run tests in parallel and easy installation by running a simple command 'pip install pytest'.", 'The agenda for the session includes making the first test with Pi Test, multiple tests and grouping them, parameterized tests, and assertions. The agenda for the session includes making the first test with Pi Test, multiple tests and grouping them, parameterized tests, and assertions.']}], 'duration': 166.116, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I11380.jpg', 'highlights': ['Pi test framework supports complex functional testing for applications and libraries, and it is open source.', "Advantages of using Pi Test include the ability to run tests in parallel and easy installation by running a simple command 'pip install pytest'.", 'The agenda for the session includes making the first test with Pi Test, multiple tests and grouping them, parameterized tests, and assertions.']}, {'end': 556.247, 'segs': [{'end': 280.412, 'src': 'heatmap', 'start': 204.796, 'weight': 0, 'content': [{'end': 215.16, 'text': "And inside this I'm going to assert or use the assert keyword and I'm going to check function give it the value 3 is equal to let's say pipe.", 'start': 204.796, 'duration': 10.364}, {'end': 221.203, 'text': 'Now to run my method or all these tests that are made over here.', 'start': 217.741, 'duration': 3.462}, {'end': 232.443, 'text': 'I just have to use one command, one simple command, that is by test and my file name, which is first test dot py,', 'start': 221.763, 'duration': 10.68}, {'end': 235.144, 'text': 'and it is showing that test session has started.', 'start': 232.443, 'duration': 2.701}, {'end': 240.925, 'text': 'it is giving collected one item and it has failed because assert 8 is not equal to 5..', 'start': 235.144, 'duration': 5.781}, {'end': 241.945, 'text': 'That is why it has failed.', 'start': 240.925, 'duration': 1.02}, {'end': 249.047, 'text': "And if I just change this value to let's say 8 and if I run this again now.", 'start': 242.785, 'duration': 6.262}, {'end': 252.948, 'text': 'It should result in one pass.', 'start': 251.508, 'duration': 1.44}, {'end': 258.985, 'text': 'So this is how easily you can write test for your any program using pytest in python guys.', 'start': 253.863, 'duration': 5.122}, {'end': 266.847, 'text': 'So let us go ahead and talk about assertions in pytest, which are nothing but checks that return either true or false,', 'start': 259.725, 'duration': 7.122}, {'end': 269.368, 'text': 'and if an assertion test fails in a program,', 'start': 266.847, 'duration': 2.521}, {'end': 274.31, 'text': 'the method execution will stop there and it will move to the next test without running the remaining code.', 'start': 269.368, 'duration': 4.942}, {'end': 278.391, 'text': 'Now, let us go ahead and take a look at multiple tests and how to run them.', 'start': 275.03, 'duration': 3.361}, {'end': 280.412, 'text': "So I'll just close this guys.", 'start': 279.071, 'duration': 1.341}], 'summary': 'Using pytest, asserts and running tests, 1 fail, 1 pass shown.', 'duration': 45.268, 'max_score': 204.796, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I204796.jpg'}, {'end': 334.919, 'src': 'embed', 'start': 304.906, 'weight': 2, 'content': [{'end': 310.13, 'text': 'We can follow two approaches which is grouping test names by substring matching and grouping by markers.', 'start': 304.906, 'duration': 5.224}, {'end': 313.041, 'text': "So I'm going to show you both before that.", 'start': 310.859, 'duration': 2.182}, {'end': 315.083, 'text': 'Let me just make my test methods.', 'start': 313.101, 'duration': 1.982}, {'end': 316.424, 'text': "So first of all, I'll just make one.", 'start': 315.203, 'duration': 1.221}, {'end': 319.826, 'text': "That is that's method one.", 'start': 318.445, 'duration': 1.381}, {'end': 323.109, 'text': "And after this, I'll give it a few value.", 'start': 321.348, 'duration': 1.761}, {'end': 334.919, 'text': "Let's just say X is equal to let's say 5 and Y is equal to let's say 10 and now I'm going to assert if X is equal to Y.", 'start': 323.129, 'duration': 11.79}], 'summary': 'Two approaches discussed for grouping test names, with example of creating a test method and assertion.', 'duration': 30.013, 'max_score': 304.906, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I304906.jpg'}, {'end': 428.372, 'src': 'heatmap', 'start': 359.741, 'weight': 0.796, 'content': [{'end': 365.965, 'text': "So I'll just write 5 over here is going to be so we have made our test guys.", 'start': 359.741, 'duration': 6.224}, {'end': 372.911, 'text': "So what I'll do now is I'll use the two approaches which is using the test names by substring matching.", 'start': 366.826, 'duration': 6.085}, {'end': 375.835, 'text': "So for that don't have to do anything guys.", 'start': 373.512, 'duration': 2.323}, {'end': 386.248, 'text': "You just have to write py dot test and after this you can just write K, give the name of your method and let's say we.", 'start': 376.435, 'duration': 9.813}, {'end': 391.354, 'text': "So let's just say we have two files and we have the same method with similar name in both the files.", 'start': 387.071, 'duration': 4.283}, {'end': 400.679, 'text': 'then we can simply use this grouping test names by sub string matching and in this dash K is used to represent the substring to match and dash V increases the verbosity.', 'start': 391.354, 'duration': 9.325}, {'end': 402.14, 'text': "I'll just run this.", 'start': 401.46, 'duration': 0.68}, {'end': 403.661, 'text': "Let's see what happens.", 'start': 403.02, 'duration': 0.641}, {'end': 413.987, 'text': 'So it has deselected 5 in 0.67 seconds and one has failed over here and instead of method 1 I can just use it for method 2 as well.', 'start': 404.361, 'duration': 9.626}, {'end': 420.126, 'text': 'and it has passed because we have written that test successfully.', 'start': 416.644, 'duration': 3.482}, {'end': 428.372, 'text': "So we know that it's working fine and the next approach to run multiple tests is to group them by markers.", 'start': 420.887, 'duration': 7.485}], 'summary': 'Using substring matching to group tests, 5 deselected, 1 failed, and multiple tests grouped by markers.', 'duration': 68.631, 'max_score': 359.741, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I359741.jpg'}, {'end': 493.479, 'src': 'heatmap', 'start': 458.252, 'weight': 0.746, 'content': [{'end': 465.275, 'text': "Now when I want to run these test, I'll just open the terminal guys and for that you have to write pi dot test.", 'start': 458.252, 'duration': 7.023}, {'end': 470.598, 'text': 'Dash M and after that you have to mention whatever the mark name is.', 'start': 466.956, 'duration': 3.642}, {'end': 473.339, 'text': "So I'll just write to first because it ended in success.", 'start': 470.758, 'duration': 2.581}, {'end': 477.772, 'text': 'Yes and for this I can just write one as well.', 'start': 474.16, 'duration': 3.612}, {'end': 483.735, 'text': 'So this is how you run multiple tests using pi test in python guys.', 'start': 479.613, 'duration': 4.122}, {'end': 485.495, 'text': 'And now that we know how it works.', 'start': 484.195, 'duration': 1.3}, {'end': 493.479, 'text': 'Let us go ahead and take a look at pipe test fixtures before that and let me just show you how you can group all these tests inside class guys.', 'start': 485.575, 'duration': 7.904}], 'summary': "Running multiple tests using 'pi test' in python and grouping tests inside a class.", 'duration': 35.227, 'max_score': 458.252, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I458252.jpg'}], 'start': 178.156, 'title': 'Writing and running tests with pytest', 'summary': 'Provides an introduction to writing tests using pytest in python, covering the process of importing test modules, writing test functions, using the assert keyword, and running tests. it also discusses running multiple tests with pytest, including grouping tests, using markers, and organizing tests inside a class.', 'chapters': [{'end': 280.412, 'start': 178.156, 'title': 'Introduction to writing tests with pytest', 'summary': 'Introduces the process of writing tests using pytest in python, demonstrating how to import test modules, write test functions, use the assert keyword for testing, run tests with a command, and understand assertions in pytest, including their impact on program execution.', 'duration': 102.256, 'highlights': ['The chapter introduces the process of writing tests using pytest in Python, demonstrating how to import test modules, write test functions, use the assert keyword for testing, run tests with a command, and understand assertions in pytest, including their impact on program execution.', "Running a test with the command 'pytest filename.py' resulted in a failed test when the assert statement 'assert 8 is not equal to 5' did not hold true, but changing the value to 8 resulted in a passing test.", 'Assertions in pytest act as checks that return either true or false, and if an assertion test fails, the method execution stops and moves to the next test without running the remaining code.']}, {'end': 556.247, 'start': 281.229, 'title': 'Running multiple tests with pytest', 'summary': 'Discusses running multiple tests using pytest, covering approaches for grouping tests, demonstrating test methods, and using markers, and organizing tests inside a class, highlighting the use of pytest to run multiple tests in python.', 'duration': 275.018, 'highlights': ['The chapter covers approaches for grouping tests by substring matching and grouping by markers, showcasing the use of pytest to run multiple tests in Python.', 'The transcript demonstrates test methods for checking the equality of values and using assertions to validate test results.', 'It explains the process of running tests using markers and specifying markers before each test, providing a practical example of running tests using pytest.', 'The transcript also illustrates organizing tests inside a class, showcasing the use of pytest to run tests within a class in Python.']}], 'duration': 378.091, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I178156.jpg', 'highlights': ['The chapter introduces the process of writing tests using pytest in Python, covering importing test modules, writing test functions, using the assert keyword, and running tests.', "Running a test with the command 'pytest filename.py' resulted in a failed test when the assert statement 'assert 8 is not equal to 5' did not hold true, but changing the value to 8 resulted in a passing test.", 'The chapter covers approaches for grouping tests by substring matching and grouping by markers, showcasing the use of pytest to run multiple tests in Python.', 'Assertions in pytest act as checks that return either true or false, and if an assertion test fails, the method execution stops and moves to the next test without running the remaining code.']}, {'end': 761.888, 'segs': [{'end': 617.966, 'src': 'embed', 'start': 558.488, 'weight': 1, 'content': [{'end': 559.469, 'text': 'Grouping dot py.', 'start': 558.488, 'duration': 0.981}, {'end': 563.33, 'text': 'So we have two test guys in this.', 'start': 560.689, 'duration': 2.641}, {'end': 568.881, 'text': 'So test session starts we have failure for class test 2.', 'start': 564.238, 'duration': 4.643}, {'end': 577.045, 'text': "Okay, I'll just run it again guys.", 'start': 568.881, 'duration': 8.164}, {'end': 587.671, 'text': 'So now we are successfully able to run both the test, and this is how you grouped your test in a class and, as you can see,', 'start': 579.647, 'duration': 8.024}, {'end': 589.332, 'text': 'we have one failed and one passed.', 'start': 587.671, 'duration': 1.661}, {'end': 593.134, 'text': 'So the test 2 has failed and test 1 has actually passed.', 'start': 590.132, 'duration': 3.002}, {'end': 600.402, 'text': 'dot over here symbolizes that it has passed and F over here symbolizes that the test case has failed.', 'start': 593.82, 'duration': 6.582}, {'end': 605.083, 'text': "and now that we are done with this, we're going to go ahead and move in fixtures in pi test.", 'start': 600.402, 'duration': 4.681}, {'end': 615.325, 'text': 'So what exactly are fixtures in pi test whenever we need to run some code before a test we use the pi test fixtures and to use pi test fixtures.', 'start': 605.943, 'duration': 9.382}, {'end': 617.966, 'text': "We have to mark the test with I'll just show you guys.", 'start': 615.365, 'duration': 2.601}], 'summary': '2 test cases run, 1 failed, 1 passed. introduction to fixtures in pytest.', 'duration': 59.478, 'max_score': 558.488, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I558488.jpg'}, {'end': 761.888, 'src': 'heatmap', 'start': 732.067, 'weight': 0, 'content': [{'end': 733.147, 'text': "So now I'll open the terminal.", 'start': 732.067, 'duration': 1.08}, {'end': 734.908, 'text': 'Okay, and just close this again.', 'start': 733.667, 'duration': 1.241}, {'end': 743.733, 'text': "I'll open the terminal now and I'll run pi test and my file name is test fixtures.", 'start': 735.428, 'duration': 8.305}, {'end': 745.456, 'text': 'dot py.', 'start': 744.815, 'duration': 0.641}, {'end': 757.825, 'text': 'So we have one failed test and to past so test method one failed because a certain is not equal to 15 and both the other tests are passed in 0.59 seconds.', 'start': 747.817, 'duration': 10.008}, {'end': 761.888, 'text': 'So this is how we use fixtures in pi tests using python guys.', 'start': 758.585, 'duration': 3.303}], 'summary': "Ran pi test on the file 'test fixtures.py', resulting in 1 failed test and 2 passed tests in 0.59 seconds.", 'duration': 29.821, 'max_score': 732.067, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I732067.jpg'}], 'start': 558.488, 'title': 'Using pytest fixtures', 'summary': 'Introduces grouping tests, explains fixtures in pytest, demonstrates fixture implementation, test cases creation, and running pytest, resulting in 1 failed test and 2 passed tests in 0.59 seconds.', 'chapters': [{'end': 617.966, 'start': 558.488, 'title': 'Grouping and fixtures in pytest', 'summary': 'Introduces grouping of tests in a class, with one test passed and one test failed, and then explains the concept of fixtures in pytest for running code before a test.', 'duration': 59.478, 'highlights': ['The chapter introduces grouping of tests in a class, with one test passed and one test failed, and then explains the concept of fixtures in Pytest for running code before a test.', 'One test passed and one test failed in the grouped test session.', 'Explanation of fixtures in Pytest for running code before a test.']}, {'end': 761.888, 'start': 618.446, 'title': 'Using fixtures in pytest with python', 'summary': 'Demonstrates the use of fixtures in pytest with python, including the implementation of fixture code, creation of test cases, and the running of pytest, resulting in one failed test and two passed tests in 0.59 seconds.', 'duration': 143.442, 'highlights': ['The chapter demonstrates the use of fixtures in Pytest with Python. The chapter illustrates the implementation of fixture code in Pytest, showcasing its usage in setting up code before each test.', 'One failed test and two passed tests were observed during the running of Pytest, with a total time of 0.59 seconds. The running of Pytest resulted in one failed test and two passed tests, with the failed test being test method one due to the assertion not being equal to 15, and the entire process took 0.59 seconds.', 'Creation of test cases was demonstrated, including the usage of fixture code for all the methods separately. The creation of test cases was exemplified, featuring the use of fixture code for all the methods separately to ensure consistent setup and execution.']}], 'duration': 203.4, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I558488.jpg', 'highlights': ['The running of Pytest resulted in one failed test and two passed tests, with the failed test being test method one due to the assertion not being equal to 15, and the entire process took 0.59 seconds.', 'The chapter introduces grouping of tests in a class, with one test passed and one test failed, and then explains the concept of fixtures in Pytest for running code before a test.', 'Creation of test cases was demonstrated, including the usage of fixture code for all the methods separately.']}, {'end': 1395.13, 'segs': [{'end': 854.167, 'src': 'embed', 'start': 818.157, 'weight': 0, 'content': [{'end': 827.383, 'text': "let's say, this is my test method and I'm going to provide all these values, that is, X, Y and Z,", 'start': 818.157, 'duration': 9.226}, {'end': 834.527, 'text': "and I'm going to just straight away give I assert and I'm going to check for X, multiplied by Y, is equal to Z.", 'start': 827.383, 'duration': 7.144}, {'end': 838.541, 'text': "So now I'm straight away going to run this test guys.", 'start': 835.7, 'duration': 2.841}, {'end': 848.145, 'text': "I'll just close this by test test parameterized.", 'start': 839.521, 'duration': 8.624}, {'end': 849.705, 'text': "That's name of my file.", 'start': 848.545, 'duration': 1.16}, {'end': 854.167, 'text': 'We have one failed and one passed.', 'start': 852.466, 'duration': 1.701}], 'summary': 'Test method checked x * y = z, resulting in one failed and one passed test.', 'duration': 36.01, 'max_score': 818.157, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I818157.jpg'}, {'end': 900.967, 'src': 'embed', 'start': 875.957, 'weight': 2, 'content': [{'end': 883.239, 'text': "and I've used a test method over here, provided these values from using the parameterize and asserted that X, multiplied by Y, is equal to Z.", 'start': 875.957, 'duration': 7.282}, {'end': 892.662, 'text': 'So this is how you can use parameterize we can use parameterize to run multiple arguments for a test and this is how easy it as it looks guys.', 'start': 884.096, 'duration': 8.566}, {'end': 900.967, 'text': "So now that we are done with this also, okay, I'll just open that fixtures file because we're going to use a few skip methods.", 'start': 893.482, 'duration': 7.485}], 'summary': 'Using parameterize, multiple arguments can be run for a test, making it easy and efficient.', 'duration': 25.01, 'max_score': 875.957, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I875957.jpg'}, {'end': 956.439, 'src': 'embed', 'start': 919.009, 'weight': 3, 'content': [{'end': 923.552, 'text': "Okay, I'll just open the terminal.", 'start': 919.009, 'duration': 4.543}, {'end': 927.155, 'text': 'By test.', 'start': 926.454, 'duration': 0.701}, {'end': 937.642, 'text': 'What is the name of file test? picture.py We have one past one skipped and one X field.', 'start': 928.155, 'duration': 9.487}, {'end': 951.418, 'text': 'So we have used the skip keyword and the X fail keyword and using that we have just skipped one test over here and we have used the X failed because it will not add into the failed.', 'start': 938.615, 'duration': 12.803}, {'end': 956.439, 'text': 'So this is how you skip our test in your test cases or use the X fail.', 'start': 952.318, 'duration': 4.121}], 'summary': 'Using skip and x fail keywords, one test was skipped in the test cases.', 'duration': 37.43, 'max_score': 919.009, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I919009.jpg'}, {'end': 1175.397, 'src': 'embed', 'start': 1147.045, 'weight': 1, 'content': [{'end': 1149.666, 'text': "So I'm going to check for response dot status code.", 'start': 1147.045, 'duration': 2.621}, {'end': 1154.428, 'text': 'And status code the valid status code is 200 guys.', 'start': 1151.447, 'duration': 2.981}, {'end': 1159.39, 'text': "So anything that is not 200 it's going to show it that it has failed or it's not a successful login guys.", 'start': 1154.608, 'duration': 4.782}, {'end': 1164.833, 'text': "And I'm going to assert token for value.", 'start': 1161.691, 'duration': 3.142}, {'end': 1171.856, 'text': "Which is equal to we're going to copy the value from over there, which is this.", 'start': 1166.313, 'duration': 5.543}, {'end': 1175.397, 'text': 'So we have made our program guys.', 'start': 1173.757, 'duration': 1.64}], 'summary': 'Program checks for valid status code (200) and asserts token value, ensuring successful login.', 'duration': 28.352, 'max_score': 1147.045, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I1147045.jpg'}, {'end': 1365.02, 'src': 'embed', 'start': 1337.749, 'weight': 4, 'content': [{'end': 1343.813, 'text': "don't forget to subscribe to edureka for more exciting tutorials and press the bell icon to get the latest updates on edureka.", 'start': 1337.749, 'duration': 6.064}, {'end': 1354.36, 'text': 'So we have created our first test case with pytest and after that we did few multiple tests where we wrote sample codes and using pytest we ran the test cases.', 'start': 1344.373, 'duration': 9.987}, {'end': 1360.958, 'text': 'Then we group the multiple test cases entire class, and we talked about assertions and parameterize test,', 'start': 1355.194, 'duration': 5.764}, {'end': 1365.02, 'text': 'and then we also took a look at by test fixtures and how you can skip the test.', 'start': 1360.958, 'duration': 4.062}], 'summary': 'Created first pytest test case, ran multiple tests using pytest, grouped test cases, discussed assertions, parameterized tests, and test fixtures, and learned how to skip tests.', 'duration': 27.271, 'max_score': 1337.749, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I1337749.jpg'}], 'start': 762.568, 'title': 'Parameterizing tests and using pytest framework for api testing', 'summary': "Discusses parameterizing tests for running multiple arguments and demonstrates testing the multiplication of variables with different input values, resulting in one failed and one passed test. it also covers using pytest framework for api testing, including skipping tests, xfail, testing login requests, asserting status codes and tokens, resulting in a successful test case, and providing an overview of the session's content.", 'chapters': [{'end': 892.662, 'start': 762.568, 'title': 'Parameterizing tests for multiple arguments', 'summary': 'Discusses how to parameterize tests to run multiple arguments for a test using the parameterize function, demonstrated through an example of testing the multiplication of variables with multiple sets of input values, resulting in one failed and one passed test.', 'duration': 130.094, 'highlights': ['The chapter discusses how to parameterize tests to run multiple arguments for a test using the parameterize function It explains the concept of parameterizing tests to run multiple arguments for a test using the parameterize function.', 'Example of testing the multiplication of variables with multiple sets of input values resulting in one failed and one passed test Demonstrates an example of testing the multiplication of variables with multiple sets of input values, resulting in one failed and one passed test.']}, {'end': 1395.13, 'start': 893.482, 'title': 'Using pytest framework for api testing', 'summary': "Covers using pytest framework for testing an api, including a demonstration of skipping tests and xfail, as well as testing a login request with pytest and asserting status codes and tokens, resulting in a successful test case and an overview of the session's content.", 'duration': 501.648, 'highlights': ['Demonstration of skipping tests and Xfail in pytest framework The presenter demonstrated the use of skip and Xfail methods in pytest framework to skip a failed test, resulting in 1 test passed, 1 test skipped, and 1 Xfail.', 'Testing a login request with pytest and asserting status codes and tokens The demonstration included testing a login request with valid credentials, asserting the status code to be 200 for a successful login, and checking the token value, resulting in a successful test case.', "Overview of the session's content and promoting Edureka's Python programming certification program The session concluded with a summary of the covered topics, including pytest framework, multiple test cases, assertions, parameterized tests, pytest fixtures, and API testing, and a promotion for Edureka's Python programming certification program."]}], 'duration': 632.562, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/byaxg00Gf9I/pics/byaxg00Gf9I762568.jpg', 'highlights': ['Demonstrates an example of testing the multiplication of variables with multiple sets of input values, resulting in one failed and one passed test.', 'The demonstration included testing a login request with valid credentials, asserting the status code to be 200 for a successful login, and checking the token value, resulting in a successful test case.', 'The chapter discusses how to parameterize tests to run multiple arguments for a test using the parameterize function.', 'The presenter demonstrated the use of skip and Xfail methods in pytest framework to skip a failed test, resulting in 1 test passed, 1 test skipped, and 1 Xfail.', "The session concluded with a summary of the covered topics, including pytest framework, multiple test cases, assertions, parameterized tests, pytest fixtures, and API testing, and a promotion for Edureka's Python programming certification program."]}], 'highlights': ["Advantages of using Pi Test include the ability to run tests in parallel and easy installation by running a simple command 'pip install pytest'.", 'The chapter introduces the process of writing tests using pytest in Python, covering importing test modules, writing test functions, using the assert keyword, and running tests.', 'The running of Pytest resulted in one failed test and two passed tests, with the failed test being test method one due to the assertion not being equal to 15, and the entire process took 0.59 seconds.', 'Demonstrates an example of testing the multiplication of variables with multiple sets of input values, resulting in one failed and one passed test.']}