Getting started with pytest Transcripts
Chapter: Test Functions
Lecture: Setting up our test environment
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
The materials for this course are on github under talk python under getting-started -with-pytest-course. It's a lot of dashes but it reads really well.
0:13
So anyway this is the link to go to to grab the materials I'm already here of course and I'm gonna just grab so if I go to the code I'm gonna
0:23
you can you can download the zip and unzip it. If you want to do that,
0:28
I'm gonna go ahead and use git and clone this and so I'm gonna just highlight that and the whole thing gets highlighted.
0:35
I don't have to go all the way over, I can just click on it and click that copied button so everything is copied in
0:42
my paste buffer and now I'm gonna go over to my command line. I've got a terminal open within my home directory.
0:51
I am at users akin kind of projects directory that I like to use for. Projects that I'm working on. I'm gonna go ahead and put the course in here so Cd
1:03
Projects and and I'm gonna do a git clone of the the directory that I copied
1:12
earlier and if I just hit enter right now it's going to create a directory called Getting started with pytest course. I don't really want that.
1:21
It's a bit long so I'm gonna shorten this by adding another pytest course and that
1:26
will create clone the repo as pytest course instead and copies everything down and go into pytest course and take a look,
1:38
I've got my license, read me projects and a bunch of chapters awesome.
1:43
Now we can set up our virtual environment and get everything installed that we need the
1:47
course. Let's start with updating pip And We'll Install Pytest first.
2:36
pytest just comes from PyPI.org so we don't have to do anything special. Now let's install the cards package and it is local to this directory.
2:49
It's right there. Cards project and we're gonna tell pip that it's local by including
2:55
a dot slash. I'm just gonna double check all the versions to make sure they
3:11
are as I expected. And I double checked that if I use these commands directly
3:37
I get the one in the virtual environment in my local directory. Now we're ready to start writing some tests.