[pytest-dev] pytest script sample

Brack, Laurent P. lpbrac at dolby.com
Tue Jan 27 21:59:22 CET 2015


Hi Abdelillah,

I thought somebody would have something smarter to say than what I am about to say, but here it is.

If the remote system you are trying to test has python installed, then I suggest that you use pytest-xdist
and distribute the tests on that machine.

However if your tests require access to resources local to the machine where pytest runs, I suggest you use
paramiko. We use it extensively for embedded device testing.

Basically, you want to do something like create an SSHClient (and even perhaps an SFTP one) in a pytest fixture (scope set to session)

http://pytest.org/latest/fixture.html

For paramiko, here is an old but still valid article on Paramiko
http://jessenoller.com/blog/2009/02/05/ssh-programming-with-paramiko-completely-different

I am sure that after reading both, you can figure out what you need to do with very little effort.

Good luck

/Laurent





On Jan 27, 2015, at 12:31 PM, Abdelillah Asraoui <aasraoui at gmail.com<mailto:aasraoui at gmail.com>> wrote:

Hello All,

I'm not getting a response here, is there another alias to send this request to ?


Thanks & Best Regard,

Abdelillah

On Sun, Jan 25, 2015 at 5:15 PM, Abdelillah Asraoui <aasraoui at gmail.com<mailto:aasraoui at gmail.com>> wrote:
Hello All,
I'm a newbie to pytest, would like to get minimum setup of files
in pytest:

+ lib
+config file for testbed
+test script

to do the following tasks :
1. ssh to a linux machine
2. run some linux commands

Can someone point out an example where i can take a look at this..

Thanks in Advance,
Abdelillah

_______________________________________________
pytest-dev mailing list
pytest-dev at python.org<mailto:pytest-dev at python.org>
https://mail.python.org/mailman/listinfo/pytest-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20150127/a65cc5f7/attachment.html>


More information about the pytest-dev mailing list