Python for Decision Makers and Business Leaders Transcripts
Chapter: Testing
Lecture: Continuous integration
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Python pairs well with Continuous Integration. Are you familiar with this term, this concept? Continuous Integration is an automated system.
0:08
It watches your source code repository for changes. Any changes detected there so basically code saved back to the project
0:16
it will automatically get that latest version run it through various tests. For example, if it was C++, you would have to compile
0:25
and link that code and then do some other stuff. Python doesn't have this compilation stuff. And the reason it's in the testing chapter
0:31
is that makes the testing part even more important. With compile languages the compiler verifies every single bit of the syntax clues together.
0:41
This function says it takes an integer and over here you are yes in fact passing an integer. If you were to pass it something else
0:47
it would fail the compilation step. Python doesn't compile so there is no compilation step. So when the only way you have to verify those types
0:54
of things is just run it and the best way to run it in Continuous Integration is well, you guessed it to write a test, probably with Pytest
1:02
that will have the same effect as well as checking the logical bits that you're trying to check. So if you want to have reliable software
1:09
and you want to do Continuous Integration or even better, Continuous Delivery check into a certain branch, it passes it automatically
1:16
'cause it's deployed to the web server or wherever you really need to have tests because without tests you haven't verified very much about Python.