Skip to content

How to Pass the value to a variable in terminal #1204

Answered by mdmintz
abdurraheemj asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @abdurraheemj You can set the environment via the command-line using built-in environments that map to self.env:

pytest --env=qa
pytest --env=production

In tests, access with self.env. You'll have to type out "production" when using that one.
Then you can use that within if statements.

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
8 replies
@mdmintz
Comment options

@Robert-Ho
Comment options

@mdmintz
Comment options

@Robert-Ho
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Comment options

You must be logged in to vote
6 replies
@mdmintz
Comment options

@abdurraheemj
Comment options

@mdmintz
Comment options

@mdmintz
Comment options

@abdurraheemj
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants