Testing with unittest | Python Code

preview_player
Показать описание
Testing code can be repetitive and if done maunually it can lead to errors being missed. Use unittest to run standard tests of your functions.
This is not a tutorial, more a 'demonstration' of how quickly you can test your program's function(s) and use the various options available to check for True, False, Equal and many more.

I've used IDLE as the IDE and Windows 10 as the OS (VM was busy running Linux for a special mission).

There is no need for any specific IDE or OS, the tests will work regardless.

If you check the Python documentation they show an example with some expected results (assertions) and some tests (steps).

This is my first adventure into the world of testing, but I like it, as it is a nice example of automation. Please comment / offer advice if you like to.

And remember : Take the time out to f label things

#Python #Code #Sotwaretesting

Check out the Minimalist online python IDE :

Рекомендации по теме
Комментарии
Автор

Cute monkey at the end, I guess that's implicit reference to code monke king's channel)))
Now to the point: unit tests are really good when a team is working with the same piece of code, the idea is to have tests for the case if someone's contribution broke something that was working before. Working for a company and freelancing alone are two major completely different approaches IMO. I mean the code style, coding habits, literally everything is different, the development philosophy is different. I believe it's very important to choose the path that fits you the most. Dr Pi, what's the career of your dream? I mean how would you like to see yourself professionally "in a perfect world"?


P.S. You new channel avatar is cool) is that you? Looks like a man from mi6)))

monkey_see_monkey_do
visit shbcf.ru