Effective PyCharm 2025 Transcripts
Chapter: HTTP Testing
Lecture: Defining Variables
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
All right, very, very cool what we got going on here with our requests, our tests. But this, this is not cool, right? This, what server is it on?
0:12
What port is it on? We might want to run these against production for certain things, or maybe some QA environment or something like that.
0:21
So notice it says run with environment. We don't have any environments. Otherwise, it would show us something other than no environment.
0:29
But we can choose, like, is there a private file? Maybe we want to exclude this from Git, and it's just a per machine configuration.
0:36
Or do we want to make this shared? I'm going to go, I'll make it shared. Why not? So we get hdvclient.env.json. And in here, we can put values.
0:48
And notice the top level bit is the environment, dev. And then the values are the things we're going to work at. So I'll do base URL.
0:57
Here we can put that. Okay. So then back here, we can say run with dev. And instead of this, we can sort of Jinja style, say base URL, autocomplete.
1:10
So glorious. So now we can put this. And if we rerun this one again, sure enough, we'll get the same data. Well, because the web app hasn't changed.
1:21
But it still works.