Python for Decision Makers and Business Leaders Transcripts
Chapter: Testing
Lecture: What else can you test with Python

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Well it makes sense that Python can test itself.
0:02 Most programming languages have some way to test
0:04 that their own code is working.
0:06 But with Python you can test other things too.
0:08 There's cool plug-ins for Pytest
0:11 that lets you just describe how
0:14 things like APIs are supposed to behave.
0:16 And then Pytest will go out, talk to that API
0:18 and very, yeah, it's returning the right data
0:20 or the right status code, and so on.
0:22 So if you need to test APIs from
0:24 the outside, Pytest is awesome!
0:26 Pytest is also good at testing IoT things.
0:29 Much of IoT's actually written in Python.
0:31 Things like Micro Python and Circuit Python.
0:34 But even when there's not, Python can interact
0:37 with those devices and test them of course.
0:40 Hardware: things like modems and cell phones
0:42 and other physical devices that
0:44 you need to communicate with; Python can test those.
0:47 In fact, we already saw that Python Bytes podcast
0:50 'cause we did that in the data signing section.
0:52 My co-host there, Brian Okken, works at a company
0:54 where they use Python all over the place
0:57 to test things like cellular modems
0:59 to make sure that they're working right.
1:00 So yeah, if you've got hardware to test
1:02 Python is a really great option, 'cause it's easy
1:05 and simple to write those tests against those devices.
1:08 Also, other languages integrate with Python.
1:12 C and C++, absolutely; Rust, it's easy to integrate
1:15 with those libraries in those languages.
1:17 So if you've got a library, let's just say, C++
1:20 and you want to test it, you could write that in C++
1:23 and maybe that makes sense.
1:24 But you could also write in Python
1:26 and test those other languages.
1:28 So here's just a sampling of what
1:29 you can test with Python and Pytest.
1:32 There are many more use cases.
1:34 I didn't even mention Selenium
1:36 for interacting with remote websites
1:37 and complicated things like, Hey, I need to go
1:40 login here, find this page, click this link
1:43 and then verify something.
1:44 Python I beautiful for that kind of stuff too.
1:46 So yeah, you can test a lot of things with Python.