207: Welcome to "Python Test", pytest course, pytest-repeat and pytest-flakefinder

Brian:

It would have been a really good idea for me to change the name from testing code to Python test for our 200th episode, but now I've gotta wait till my 207th episode. Anyway, let's do an intro. Welcome to Python test. Alright. So let's, address the name change right away.

Brian:

This podcast started out being the Python test pod cast. And then at some point early on, I decided that I was pigeonholing myself too much. And so I changed the name to test end code, but I put an ampersand in the logo. And so there's a and and spelled out in the website name. And, anyway, after 206 episodes, mostly it's about testing.

Brian:

Mostly it's about Python. So I'm just gonna embrace it, and I'm gonna call it Python test and go from there. For now, though, the the show notes and everything are still at test and code with the and spelled out, test and code dot com. Eventually, I may switch that to python test.com or part of it or a subdomain or something. But for now, it's still a test encode.

Brian:

But the, the feed doesn't change, so you don't have if you're subscribed, you don't have to change anything. Anyway, okay. Now, the logo, the test and code logo, I probably should change that for Python test. I don't know what to do for that though, so I just put some stickers over it. So that's why the logo is different.

Brian:

Just some, digital stickers. I spent a few minutes in Acorn, which is a pretty cool, image processor for for Macs. So, anyway, let's move on. The name's changed, and I've already spent too much time talking about that. What I wanted to talk about is one of the reasons why it's been so long since my last episode.

Brian:

Okay. We're gonna talk about a whole bunch of stuff in this episode. It's kind of a catch up thing. I've been working on a video course, for pytest. Basically, it's based on I know I already have a course that's on the talk Python training.

Brian:

It's an excellent course. You should go check it out. It's about 3 and a half hours, I think, last time I looked, And it's on the yeah. It's on Talk Python training. So what's the new one about?

Brian:

The the one that's on talk Python is, like a fairly quick introduction to pytest, but I'd cover a whole bunch more detail in the pytest book. So that's what this new course is. It's the entire Python testing with Pytest 2nd edition book in, video course format. And then, also, when I'm recording it, sometimes there's a few things that maybe could be rearranged a little bit, and then I forgot some stuff. So there's actually more stuff.

Brian:

There's a a few extra bonuses. I'll probably include more as time goes on, with the with the book. So to check that out, the check check the course out, it's at you can go to python test.com/course, and I'll have a link in the show notes too. But, it's it's in 3 parts like the book is. There's, there's part 1, part 2, part 3.

Brian:

The part 1 is pytest primary power. I cover all of the foundational information around pytest. If you just and that one's complete. If you just took that even, just the part 1, you would be on really solid foundation for using pytest. Part 2 is, working with projects, and then part 3 is booster rockets.

Brian:

Working with projects is pretty fun. We do things like, incorporate code coverage and do talks and a whole bunch of goodies. The, I've started, part 2. I got the I have the testing strategy chapter up, so through chapter 7, but that's it so far. But it's gonna continue.

Brian:

There will be 16 chapters in total, but if you buy it now, you get all of that. And right now, I'm offering the I might change my mind in the future, but I might not. I'm no no promises there. But right now, you get for one price, you get you get access to if you if you grab part 1, you get all the parts, and that's as of end of September. I'm not gonna change it in September.

Brian:

But when I complete the whole thing, then I'm gonna I might re rethink about the pricing model. But for right now, I don't wanna think about that. I just wanna think about finishing the course. But that's why I really haven't gotten a lot of podcasts out lately. But I have done some other things.

Brian:

I do wanna address one more thing about the course though before we move on. There's, there's 2 pricing models I wanted. There's a low price one that's, a lower price that is just the video course only, but I wanted to have the experience available to people if they wanted to, if it was like like I'm sitting right next to him teaching him Pytest. And the problem with the video course is you can't ask questions back. But, but I so there's 2 pricing options.

Brian:

One of them is, just watch the video course. You have access to everything, and you have access to the code download. There's a community edition one that's a a little bit higher price, but it is, it's got you've got access to the GitHub repo, so you can just clone the code, and you can get poll you can just, get a get poll for updates when I add new chapters. And then you have access to a Slack and a Discord and, and just to be able to ask questions. So if you have any have any troubles, that's there.

Brian:

Okay. Moving on. Let's talk about some of the other stuff I've been up to. I started another podcast called Python People. I'm really excited about this.

Brian:

It's been been fun. Again, I haven't slowed down on these, interviews, but, but I'm I have slowed down on actually getting them posted. So I've got a whole bunch of a backlog of Python people episodes. And what this is is, really, instead of trying to get details out of like, a lot of Python podcasts or tech podcasts are trying to teach you something. There's nothing wrong with that.

Brian:

I love those kind of podcasts, and this is one of those podcasts. But I also like to just get to know people. I really love the Python community. So the Python people is really about just getting to know some of the people that are involved with Python and some of the just some people that even just use it, just our users of Python, and, and then some of the core people. And you check it out.

Brian:

It's I think it's fun conversations. Sometimes for with some people, they're just comfortable with talking about the work they're doing or the projects they're working on, and that's fine. But some people are comfortable with talking about all sorts of stuff like, you know, their hobbies and whatever. So Michael Kennedy was on, and we talked about motorcycles. That was fun.

Brian:

So that's Python people also. The other thing I've been working on is open source contributions. So there is, a plugin called pytestrepeat, and I, I'd like to try to help out with this project. And I have my own open source projects. Pytestcheck is one I started, and I've got a couple other small ones.

Brian:

Pytestcheck is the only one that really a lot of people use. And, but I'm the, the core maintainer for that, so I get to make up the rules. I'd like to help out with pytestrepeat, but it's already been it's already been a project that other people have worked on, and it's part of the pytest dev community umbrella. And I'd like to try, and I'm starting to contribute and learn all of the maintainer bits. It's a little bit different to maintain help maintain somebody a a project that somebody else started.

Brian:

That's a little different than maintaining your own project, and I'm enjoying learning learning the ropes there. And, Bruno Olivia, who goes goes by the name of Nicodermis a lot on online stuff, he's been helping me out a lot, and I really appreciate it. And it's been a great experience so far. Anyway, now I wanna talk about pytest repeat. One of the reasons why I got into it is because it looked like it hadn't been updated too much lately, but it still works fine on pytest, on Python 11 and pytest 7.

Brian:

It just doesn't look like it if you look at the, like, what what's being tested. So, I'm helping to contribute to that, and, that'll be fun. But why did I wanna try to contribute? Well, partly, it's because it hasn't been updated for a while, and I wanna I'd like to do I I started with, like, moving the, the testing, the CI background back stuff, moving that from Jenkins, or is it Jake? No.

Brian:

It wasn't Jenkins. It was, oh, I even forget what the Travis. It was on Jeff Travis. That's right. Moving it from Travis to, GitHub actions because that's where I'm most familiar with.

Brian:

So did that already, but I haven't done a release with that yet. The that's the next part is to try to figure out the this whole new release process that PyPI is working with and pytestdev projects are under. It it there's another thing also is that there's a feature of pytest repeat that is that needs to be highlighted a little bit better because it was documented, but I didn't know about it. So what pytestrepeat does is it repeats the tests that you pointed at. So let's say you've got a a test suite of 10 tests, and you tell pytest repeat to repeat everything twice.

Brian:

What it'll do is it'll go to the first test and run it twice, and then the second test and run that twice, and so forth. That might be what you meant. But, usually, what I mean is I wanna run all 10 tests and then and then start over again and run the whole thing over again. Why would you do that? It's it's all often because there's something that some intermittent failure, and you wanna run the whole thing a bunch of times overnight or something.

Brian:

So there's another related plugin called Pytest Flake Finder, Completely different name. You got repeat and FlakeFinder. And FlakeFinder, by default, does kind of the opposite. Instead of repeating each test and then going on to the next one, it kind of it does all 10. So that's usually what I want it to do.

Brian:

But I was like, how could we add that to pytest repeat? Because pytest repeat is like the name that I'm thinking of when I wanna repeat tests. So I took a look at it, and there is oh, I'll just bring it up right now so I'm not, like, making this up. In the read me, there is the there's a title called repeating tests and talks about that, and then there's a little code sample. And then there's 2 paragraphs under it that say, if you want to override the default text execution order, you can use repeat scope option with one of the next values, session, module, class, or function.

Brian:

So if you pass in repeat scope and then the word session, it'll do exactly what I wanted it to do, which was repeat the whole thing and then start over and re like, do all 10 tests and then repeat the whole thing over again or with however many you you want. That's so cool. So, the only thing and it's even documented well. I just missed it. I think another heading there would be good of, like, you know, change the scope.

Brian:

I don't know what the heading would be, but I'll play with it, thinking about that. I'd like to contribute to that. So, if you wanna repeat things, right now, repeat, pytest repeat works fine. But you can do flake finer. Both of them work fine.

Brian:

I'll put links in the show notes, but try both of those. I just bring it up because I don't know why I didn't see that repeat scope before. And, I've talked with other people that have said, oh, yeah. That's what I wanted, but I didn't know that it would do that. So, if you've ever wanted to repeat stuff, do that.

Brian:

I guess what is there other stuff I wanted to talk about? I do have a a whole list of, episodes that I wanna talk discuss related to, test driven development and, lean software development. But I kinda have to develop those ideas. So I think what I'll do is do some of these, like, shorter little, catch up episodes or talk about a plug in or something like that, and then, interleave those with, the longer SAA ones. And as far as, interviews with other people about stuff, like, I'd like to talk about more, packaging.

Brian:

I'd like to to interview somebody about Hatch and Hatchling and more about Flit and talk with Brett Cannon about, you know, as things develop and all bunch of other people. But the interviews and stuff, they're gonna have to kinda wait until I get this Pytest course done because, I'm already doing a lot of interviews and doing Python Bytes. And it's kinda cool. I didn't even think about this until after I decided to rename testing code to Python test. So now I've got 3 podcasts.

Brian:

They're Python test, Python people, and Python bytes. So that's neat. They all match. Anyway, thanks a ton for following this podcast, even though I'm not doing it as often. Thanks so much.

Brian:

That's it for today. Now go ahead and test something.

Creators and Guests

Brian Okken
Host
Brian Okken
Software Engineer, also on Python Bytes and Python People podcasts
207: Welcome to "Python Test", pytest course, pytest-repeat and pytest-flakefinder
Broadcast by