<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 23, 2017 at 10:41 PM arun kali raja &lt;<a href="mailto:arunsep886@gmail.com">arunsep886@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">I am using jenkins-like tool for doing CI and i will have  jobs for each release.. <div dir="auto"><br></div><div dir="auto">So instead of having a text file, if the variables are mentioned in the invocation then it&#39;s easy for users to use it...</div></div></blockquote><div><br></div><div>As a workaround to your original question, realize you can write a file just as easily as passing an argument to something:</div><div><br></div><div>$ pytest --variables-on-cmdline=[[JSON_CONTENTS]]</div><div><br></div><div>can become:</div><div><br></div><div>$ echo [[JSON_CONTENTS]] &gt; input.json</div><div>$ pytest --variables=input.json</div><div><br></div><div>But keep in mind this will need careful and complex shell escaping.</div><div><br></div><div>I&#39;m sure there is a better ways to accomplish this if you would explain your use case in more details. <br></div><div><br></div><div>Cheers,</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote">On 24-Aug-2017 2:04 AM, &quot;Bruno Oliveira&quot; &lt;<a href="mailto:nicoddemus@gmail.com" target="_blank">nicoddemus@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Arun,<div><br></div><div>On Wed, Aug 23, 2017 at 3:15 PM arun kali raja &lt;<a href="mailto:arunsep886@gmail.com" target="_blank">arunsep886@gmail.com</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>So i was thinking i will have a pytest option to accept a dict or json  (as string and then literal-eval). </div></div></blockquote><div><br></div><div>You mean passing a json or dict literal in the command line? If so it doesn&#39;t seem like a good idea, dicts/json will contain a lot of special characters that need to be shell-escaped.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Or is there a better way altogether to do this..</div></div></blockquote><div><br></div><div>What&#39;s wrong with passing the variables using a file?</div><div><br></div><div>Cheers,</div><div>Bruno.</div></div></div>
</blockquote></div></div>
</blockquote></div></div>