Skip to content

Generating a UUID per invocation? #2279

Discussion options

You must be logged in to vote

@jugmac00 I found a perfect solution: tox-backticks. This allowed me to do this

[tox]
requires = tox-backticks

commands_pre = 
    dotenv -f {toxinidir}{/}sensitive.env run "{env:PSQL_EXE}" -c "DROP DATABASE IF EXISTS {env:TEST_DB}"
commands =
    pytest
commands_post = 
    dotenv -f {toxinidir}{/}sensitive.env run "{env:PSQL_EXE}" -c "DROP DATABASE{env:TEST_DB}"
setenv = 
    TEST_DB=`python -c 'import sys; sys.stdout.write("{envname}".replace("-", ""))'`

I used the envname with the "-" removed as a UUID.
Thanks for the rubber ducking!

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Anti-Distinctlyminty
Comment options

Comment options

You must be logged in to vote
2 replies
@Anti-Distinctlyminty
Comment options

@jugmac00
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Anti-Distinctlyminty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants