Using Doppler With Python UnitTest

When trying to use Doppler and running tests (using UnitTest) an error is received when trying to run the verbose flag:

But if you don’t use Doppler, the secrets aren’t used so it fails. Not sure if there’s something I’m missing from documentation or if I missed it.

UPDATE: It works when using the “multi-command” CLI notation
doppler run --command="python test_main.py -v"

Oh, I just found this - will try this and see if it resolves the issue.

Confirming that it does! Repo with code for testing is here.

Hi @ProsperousHeart!

Glad you found a way that works! When using doppler run the expected syntax is something like this:

doppler run -- python test_main.py -v

where the command you’re executing comes after the --. You can also use --command as you found, but that’s typically for cases where you need to reference one of the injected variables in the command parameters. For example:

doppler run --command 'some-command -param $SOME_SECRET'

In your case, you should be able to use the -- syntax.

Regards,
-Joel

1 Like

Why are all of my messages flagged as spam?

I explained this in my other post. You should be good to go now though!

1 Like

Yes, thank you so much for your time and follow up :heartpulse: