Build your own Python unit test framework in 100 lines of code - part 2
In this video step by step we'll build our own Python unit testing framework. In the first part we wrote a test runner, and now we'll work on our own assertion librar
Hi folks! Welcome to Not Only Code! Today we're doing an intermediate/advanced Python tutorial where you'll build your own Python unit testing framework that will be a simple version of libraries like unittest or pytest.
⌨️ Source code: https://github.com/arnvald/noctest
📚 Resources
All the libraries I use in this tutorial are part of Python standard library, I don't use any external sources
* https://docs.python.org/3/library/inspect.html - inspect library I use to get all methods from a module to find tests there
* https://docs.python.org/3/library/importlib.html - importlib is a library that gives API to load modules using file path instead of a module name
* https://docs.python.org/3/library/types.html - types library I use to create a new module
* https://docs.python.org/3/library/operator.html - operator module offerst functions that act like operators, for example == or !=
🎥 Timeline:
0:00 recap of part 1
0:47 what is assertion library
1:52 turn module into a package
2:44 make package executable
4:24 assertion library scaffold
7:37 custom toEqual function
8:45 support the new library
11:32 add notToEqual
13:00 refactoring expectation module
17:52 support for toInclude function
19:50 writing custom operator function
21:43 update test reporting
25:06 in the next episode...
If you enjoy this kind of content, check out my website, 🌏 https://notonlycode.org, where I publish more in-depth articles about software development.
As always, if you have any questions, suggestions or feedback, you can contact me:
✉️ email: gregory@notonlycode.org
🐦 Twitter: @GregoryWitek
Видео Build your own Python unit test framework in 100 lines of code - part 2 канала Not Only Code
Hi folks! Welcome to Not Only Code! Today we're doing an intermediate/advanced Python tutorial where you'll build your own Python unit testing framework that will be a simple version of libraries like unittest or pytest.
⌨️ Source code: https://github.com/arnvald/noctest
📚 Resources
All the libraries I use in this tutorial are part of Python standard library, I don't use any external sources
* https://docs.python.org/3/library/inspect.html - inspect library I use to get all methods from a module to find tests there
* https://docs.python.org/3/library/importlib.html - importlib is a library that gives API to load modules using file path instead of a module name
* https://docs.python.org/3/library/types.html - types library I use to create a new module
* https://docs.python.org/3/library/operator.html - operator module offerst functions that act like operators, for example == or !=
🎥 Timeline:
0:00 recap of part 1
0:47 what is assertion library
1:52 turn module into a package
2:44 make package executable
4:24 assertion library scaffold
7:37 custom toEqual function
8:45 support the new library
11:32 add notToEqual
13:00 refactoring expectation module
17:52 support for toInclude function
19:50 writing custom operator function
21:43 update test reporting
25:06 in the next episode...
If you enjoy this kind of content, check out my website, 🌏 https://notonlycode.org, where I publish more in-depth articles about software development.
As always, if you have any questions, suggestions or feedback, you can contact me:
✉️ email: gregory@notonlycode.org
🐦 Twitter: @GregoryWitek
Видео Build your own Python unit test framework in 100 lines of code - part 2 канала Not Only Code
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Write READABLE CODE and become a better developer!](https://i.ytimg.com/vi/R4MoHpSaX1I/default.jpg)
![How to Get Promoted - Becoming a Senior Developer #7](https://i.ytimg.com/vi/EWtyK2SSWqU/default.jpg)
![5 different ways to get a job as a software developer](https://i.ytimg.com/vi/saBZV12XR9I/default.jpg)
![become a BETTER SOFTWARE DEVELOPER with a pyramid of skills](https://i.ytimg.com/vi/2y2zXgyF_SM/default.jpg)
![To All Junior Developers Looking for a Job in Pandemic](https://i.ytimg.com/vi/kzG3SeKmGP0/default.jpg)
![Leadership for introverts: can introvert be a good manager?](https://i.ytimg.com/vi/WY5tcz8voVo/default.jpg)
![Should engineering managers write code?](https://i.ytimg.com/vi/yBbYJSRYWvo/default.jpg)
![5 ways to improve programming skills](https://i.ytimg.com/vi/D0tGKfb-fLk/default.jpg)
![Cover letters for software developers - you DON'T NEED them!](https://i.ytimg.com/vi/rzq2Qf7gIu0/default.jpg)
![How to talk to micromanager - Things Developers Hate #3](https://i.ytimg.com/vi/vKm7RKE2Rls/default.jpg)
![How to do Good Code Reviews in 5 Steps - Becoming a Senior Developer #6](https://i.ytimg.com/vi/bEShvpcbD84/default.jpg)
![How to write good code? Look at it and ask these questions!](https://i.ytimg.com/vi/i60Hnhuf6EE/default.jpg)
![How to negotiate salary as a software developer (when you lack confidence)](https://i.ytimg.com/vi/g12Sd4-zRc8/default.jpg)
![Soft skills FOR SOFTWARE DEVELOPERS - the key to a successful career](https://i.ytimg.com/vi/4O7nF7xnO-U/default.jpg)
![Cursed promotion - when you're not ready for your new role](https://i.ytimg.com/vi/MbJ9Gc4qD1E/default.jpg)
![Reading software developer job descriptions part 2 #shorts](https://i.ytimg.com/vi/-eseANe5Q5c/default.jpg)
![Dealing with Deadlines - Things Developers Hate #1](https://i.ytimg.com/vi/6d3g-OItF2k/default.jpg)
![How to become a tech lead or engineering manager | leadership for software developers](https://i.ytimg.com/vi/UmAcVmUk-gc/default.jpg)
![Choose Your Next Programming Language - Becoming a Senior Developer #8](https://i.ytimg.com/vi/eWbp2hohBHQ/default.jpg)
![LIVE: Is engineering management for you? and other tech career questions](https://i.ytimg.com/vi/5F920FbIk0s/default.jpg)