From nicoddemus at gmail.com Fri Jan 2 14:10:48 2015 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Fri, 2 Jan 2015 11:10:48 -0200 Subject: [pytest-dev] Fixtures not being found when module is named "conftest" Message-ID: Hi everyone! Suppose the following files: # foo/conftest.py import pytest @pytest.fixture def my_fixture(): return 1 # foo/__init__.py # bar/conftest.py pytest_plugins = ['foo.conftest'] # bar/test_bar.py def test_it(my_fixture): assert my_fixture == 1 Supposing your PYTHONPATH is configured so you can import "foo.conftest", running "py.test bar" fails because it does not find "my_fixture". However, if you rename "foo/conftest.py" to something else like "foo/plugin.py" and update the reference in "bar/conftest.py", then pytest is able to find "my_fixture". Looking at the code, I see that there is a special case for "conftest.py" files in _pytest.python, line 1617. I was wondering what is the rationale behind this? I was under the impression that "conftest.py" files where simply plugins which were loaded automatically based on their relative location to the tests. In my case, I would like to reuse fixtures defined in conftest files between different projects. For instance, project2 depends on project1's fixtures which are defined in a conftest file, so I would like to simply add a "pytest_plugins = ['project1.conftest']" to project2's own conftest file. If I understand correctly, I would have to move project1's fixture to a different file, say "project1.plugin", and reference it in both project1 and project2's conftest files. Is this the recommended approach? Cheers, Bruno -------------- next part -------------- An HTML attachment was scrubbed... URL: From bubenkoff at gmail.com Sat Jan 17 12:52:14 2015 From: bubenkoff at gmail.com (Anatoly Bubenkov) Date: Sat, 17 Jan 2015 12:52:14 +0100 Subject: [pytest-dev] pytest-cloud Message-ID: Hi i drafted a simple plugin (you can look at it as a subplugin of pytest-xdist) which allows you to automatically choose test nodes and the number of tests per node depending on the node capabilities. It was a bit tricky to choose those parameters before, i hope not anymore with pytest-cloud. Probably can be merged into pytest-xdist later on. https://github.com/pytest-dev/pytest-cloud Any feedback is more than welcome. -- Anatoly Bubenkov -------------- next part -------------- An HTML attachment was scrubbed... URL: From flub at devork.be Sun Jan 18 10:42:48 2015 From: flub at devork.be (Floris Bruynooghe) Date: Sun, 18 Jan 2015 10:42:48 +0100 Subject: [pytest-dev] Fixtures not being found when module is named "conftest" In-Reply-To: References: Message-ID: Hi Bruno, On 2 Jan 2015 14:11, "Bruno Oliveira" wrote: > In my case, I would like to reuse fixtures defined in conftest files between different projects. > For instance, project2 depends on project1's fixtures which are defined in a conftest file, so I would like to simply add a "pytest_plugins = ['project1.conftest']" to project2's own conftest file. If I understand correctly, I would have to move project1's fixture to a different file, say "project1.plugin", and reference it in both project1 and project2's conftest files. Is this the recommended approach? I would say so indeed. If you need to share fixtures between projects then I would create a 3rd project which provides a the plugin under a name. The contest.py files are meant for within a single project/directory structure and personally I frown upon any manual importing or otherwise loading them. They ought to be strictly related to their location so once you need to start importing them or loading them as a plugin explicitly it is a sign to me that the code is in the wrong place. Regards, Floris -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Mon Jan 19 13:09:10 2015 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Mon, 19 Jan 2015 10:09:10 -0200 Subject: [pytest-dev] Fixtures not being found when module is named "conftest" In-Reply-To: References: Message-ID: Hi Floris, Thanks for the response and clarification, I'm following the approach you suggested and it's working fine. Cheers, Bruno. On Sun, Jan 18, 2015 at 7:42 AM, Floris Bruynooghe wrote: > Hi Bruno, > > On 2 Jan 2015 14:11, "Bruno Oliveira" wrote: > > In my case, I would like to reuse fixtures defined in conftest files > between different projects. > > For instance, project2 depends on project1's fixtures which are defined > in a conftest file, so I would like to simply add a "pytest_plugins = > ['project1.conftest']" to project2's own conftest file. If I understand > correctly, I would have to move project1's fixture to a different file, say > "project1.plugin", and reference it in both project1 and project2's > conftest files. Is this the recommended approach? > > I would say so indeed. If you need to share fixtures between projects then > I would create a 3rd project which provides a the plugin under a name. > > The contest.py files are meant for within a single project/directory > structure and personally I frown upon any manual importing or otherwise > loading them. They ought to be strictly related to their location so once > you need to start importing them or loading them as a plugin explicitly it > is a sign to me that the code is in the wrong place. > > Regards, > Floris > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cesar.canassa at gmail.com Mon Jan 19 16:33:10 2015 From: cesar.canassa at gmail.com (Cesar Canassa) Date: Mon, 19 Jan 2015 13:33:10 -0200 Subject: [pytest-dev] Automatically converting unittest asserts to py.test asserts. Message-ID: Hi, In my current company, I recently switched from using Unittest to Py.test in our Flask application. I loved Py.test and I decided to start rewriting our tests using Py.test style asserts instead of Unittest asserts (self.assertEqual, self.assertFalse, et al). Since we have already written hundreds of thousands of lines of test code, manually converting the tests would take too long, so I have decided to automate the process. The automation effort resulted in this script: https://gist.github.com/canassa/4fd63d682d90f5e3f07e The script is not perfect, you still need to manually review some changes it makes, but at least in our project it worked amazingly well, so I decided to share it with you. Best, Cesar Canassa -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Mon Jan 19 16:50:22 2015 From: holger at merlinux.eu (holger krekel) Date: Mon, 19 Jan 2015 15:50:22 +0000 Subject: [pytest-dev] Automatically converting unittest asserts to py.test asserts. In-Reply-To: References: Message-ID: <20150119155022.GE12060@merlinux.eu> Hi Cesar, On Mon, Jan 19, 2015 at 13:33 -0200, Cesar Canassa wrote: > Hi, > > In my current company, I recently switched from using Unittest to Py.test > in our Flask application. I loved Py.test and I decided to start rewriting > our tests using Py.test style asserts instead of Unittest asserts > (self.assertEqual, self.assertFalse, et al). > > Since we have already written hundreds of thousands of lines of test code, > manually converting the tests would take too long, so I have decided to > automate the process. The automation effort resulted in this script: > > https://gist.github.com/canassa/4fd63d682d90f5e3f07e > > The script is not perfect, you still need to manually review some changes > it makes, but at least in our project it worked amazingly well, so I > decided to share it with you. Thanks. There also is a tool that (for historic reason) comes with "py", namely py.convert_unittest, which is always installed with py.test. Can you imagine to do a proper pytest_convert_unittest repository which we can then link prominently from pytest.org? I am sure there are others who are interested in this. cheers, holger > > Best, > Cesar Canassa > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev From cesar.canassa at gmail.com Mon Jan 19 17:41:20 2015 From: cesar.canassa at gmail.com (Cesar Canassa) Date: Mon, 19 Jan 2015 14:41:20 -0200 Subject: [pytest-dev] Automatically converting unittest asserts to py.test asserts. In-Reply-To: <20150119155022.GE12060@merlinux.eu> References: <20150119155022.GE12060@merlinux.eu> Message-ID: Abdelilah: You have to create a wrapper script and call it from there, here is a sample one: from lib2to3.refactor import RefactoringTool > import sys > > if __name__ == '__main__': > if len(sys.argv) < 2: > sys.exit('Usage: topytest.py [FILE ...]') > refactoring_tool = RefactoringTool(['fix_pytest']) > refactoring_tool.refactor(sys.argv[1:], write=True) Holger: Sure! I will start a repository for it. Best, Cesar Canassa On Mon, Jan 19, 2015 at 1:50 PM, holger krekel wrote: > Hi Cesar, > > On Mon, Jan 19, 2015 at 13:33 -0200, Cesar Canassa wrote: > > Hi, > > > > In my current company, I recently switched from using Unittest to Py.test > > in our Flask application. I loved Py.test and I decided to start > rewriting > > our tests using Py.test style asserts instead of Unittest asserts > > (self.assertEqual, self.assertFalse, et al). > > > > Since we have already written hundreds of thousands of lines of test > code, > > manually converting the tests would take too long, so I have decided to > > automate the process. The automation effort resulted in this script: > > > > https://gist.github.com/canassa/4fd63d682d90f5e3f07e > > > > The script is not perfect, you still need to manually review some changes > > it makes, but at least in our project it worked amazingly well, so I > > decided to share it with you. > > Thanks. There also is a tool that (for historic reason) comes with "py", > namely py.convert_unittest, which is always installed with py.test. > Can you imagine to do a proper pytest_convert_unittest repository which > we can then link prominently from pytest.org? I am sure there are others > who are interested in this. > > cheers, > holger > > > > > Best, > > Cesar Canassa > > > _______________________________________________ > > pytest-dev mailing list > > pytest-dev at python.org > > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tibor.arpas at infinit.sk Mon Jan 19 19:10:45 2015 From: tibor.arpas at infinit.sk (Tibor Arpas) Date: Mon, 19 Jan 2015 19:10:45 +0100 Subject: [pytest-dev] Crowdfunding a pytest plugin In-Reply-To: References: Message-ID: Hello everyone, the campaign is live now: http://www.indiegogo.com/at/testmon We simply track the module to module dependencies for now, which is much simpler but still demostrates the benefits nicely. We kindly ask now for your feedback and contributions. Thanks! Tibor On Fri, Dec 12, 2014 at 3:21 PM, Tibor Arpas wrote: > Hello pytesters, > > We are putting together a small Indiegogo campaign for a pytest plugin > which should significantly improve the experience of executing a long > test suite. We'd be glad to hear any feedback before launching it. The > draft is here: https://www.indiegogo.com/project/preview/4fe07d66 > > Also, is anybody interested in helping with promotion and/or development? > > Cheers, > Tibor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Mon Jan 19 20:37:00 2015 From: holger at merlinux.eu (holger krekel) Date: Mon, 19 Jan 2015 19:37:00 +0000 Subject: [pytest-dev] Crowdfunding a pytest plugin In-Reply-To: References: <46C88FB1-F0FA-4AD3-B2E2-5285D438DABB@florian-schulze.net> Message-ID: <20150119193700.GH12060@merlinux.eu> On Fri, Dec 12, 2014 at 07:36 -0800, Marc Abramowitz wrote: > Yes this could be interesting and I'd consider asking my company to donate if it has clear benefits over what's already out there. > > As Florian mentioned, pytest-cache lets you rerun failed tests. And pytest-sugar gives you nice progress and instant failures as they happen. pytest-xdist helps parallelize and speed up slow tests. > > I wonder if pytest-cache should be in pytest core? Personally I always forget to install and use it. (Which maybe says more about me than about pytest or pytest-cache) But _maybe_ if it was in core, it would be more likely to be discovered and used? Sorry, kind of a tangent. FWIW Ronny is working on pytest-cache related refactorings and the plan indeed is to put pytest-cache functionality into pytest-core. best, holger > Perhaps a demo would make it clearer what you're envisioning? > > -Marc > http://marc-abramowitz.com > Sent from my iPhone 4S > > > On Dec 12, 2014, at 7:17 AM, "Florian Schulze" wrote: > > >> We are putting together a small Indiegogo campaign for a pytest plugin > >> which should significantly improve the experience of executing a long > >> test suite. We'd be glad to hear any feedback before launching it. The > >> draft is here: https://www.indiegogo.com/project/preview/4fe07d66 > > > > This certainly looks interesting. > > > > The "last failures" part is implemented in pytest-cache, are you aware of that? > > > > The reordering by speed sounds nice. Be aware, that fixture setup/teardown may be influenced by reordering and thus change the overall test execution time. I discovered this while extending pytest-random. > > > > I also thought about using something like coverage to only run affected tests. How much testing did you do in your prototype? Do you keep track of (pip/setuptools) installed packages (versions)? Did you try changes at various levels like new files, modules, classes, metaclasses, mocks etc? Python is very dynamic as you most likely know :) > > > > Regards, > > Florian Schulze > > _______________________________________________ > > pytest-dev mailing list > > pytest-dev at python.org > > https://mail.python.org/mailman/listinfo/pytest-dev > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > From holger at merlinux.eu Mon Jan 19 21:24:30 2015 From: holger at merlinux.eu (holger krekel) Date: Mon, 19 Jan 2015 20:24:30 +0000 Subject: [pytest-dev] FOSDEM / Saturday pytest meetup in Bruxelles Message-ID: <20150119202430.GI12060@merlinux.eu> Hi folks, as some of you know some pytest devs are going to meet at FOSDEM in Bruxelles end of the month. ASFAIK, Anatoly Bubenkoff, Brianna Laugher, Floris Bruynooghe and me are bound to come, anyone else? During our meetup i'd like to discuss and work on finalizing https://bitbucket.org/pytest-dev as the new place for pytest core, py, pytest-xdist, pytest-cache, ..., tox, repositories and using a unified contribution process for all of them. I'd also like to discuss going for a little crowd-funding project that automates testing and releasing pytest-dev packages including pushing docs to the respective sites. Bruno Oliveira has already done some work for visualizing the pytest-plugin status against the latest pytest release which can probably be re-used http://pytest.org/latest/plugins_index/index.html As to the location at FOSDEM, I suggest to meetup 4pm around the Python FOSDEM room: http://python-fosdem.org/#location I'll probably be there during the day but also have some other appointments so can't guarantee that. I'll arrive friday evening but will probably directly go to Pieter Hintjens's flat and only arrive saturday morning at the conf site. best, holger -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: Digital signature URL: From bubenkoff at gmail.com Mon Jan 19 21:27:01 2015 From: bubenkoff at gmail.com (Anatoly Bubenkov) Date: Mon, 19 Jan 2015 21:27:01 +0100 Subject: [pytest-dev] FOSDEM / Saturday pytest meetup in Bruxelles In-Reply-To: <20150119202430.GI12060@merlinux.eu> References: <20150119202430.GI12060@merlinux.eu> Message-ID: see you all there! On 19 January 2015 at 21:24, holger krekel wrote: > Hi folks, > > as some of you know some pytest devs are going to meet at FOSDEM > in Bruxelles end of the month. ASFAIK, Anatoly Bubenkoff, Brianna Laugher, > Floris Bruynooghe and me are bound to come, anyone else? > > During our meetup i'd like to discuss and work on finalizing > https://bitbucket.org/pytest-dev as the new place for pytest core, py, > pytest-xdist, pytest-cache, ..., tox, repositories and using a unified > contribution process for all of them. > > I'd also like to discuss going for a little crowd-funding project that > automates testing and releasing pytest-dev packages including pushing docs > to the respective sites. Bruno Oliveira has already done some work > for visualizing the pytest-plugin status against the latest pytest release > which can probably be re-used > http://pytest.org/latest/plugins_index/index.html > > As to the location at FOSDEM, I suggest to meetup 4pm around the > Python FOSDEM room: http://python-fosdem.org/#location > I'll probably be there during the day but also have some other > appointments so can't guarantee that. I'll arrive friday evening > but will probably directly go to Pieter Hintjens's flat and only arrive > saturday morning at the conf site. > > best, > holger > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQEcBAEBAgAGBQJUvWf+AAoJEI47A6J5t3LW45AIAJ36pk7VHXJ/y7t4p//lpLqP > QoJCYNzrdd+F9rN9mccoRR8oPH/i/IRkJgYWmz79oH/WV557HBrX2D4oUE/BsDJ8 > Dpk2hx0sGqAHCylwHxGvMA1mHvNA9HgVdnsynjxHs98D544r/ZqiKQxM0aaoFEtx > ljyEuEV7rkB/LxHHZqRvwnrcnQlPMk9uPgRwKyWRWCvirLXLt7XPOMKMuqb4GaVj > Sm0ibd/PVCnoczlzLeiXRzZvpRe0ohVQqn1VfP6yFTtiNv7UMD6Y/P+ncVgeqrCa > K4G3rVow2mgioWtEAD1hYdqXmLpotYUhZRSmU82WzSbv2+6FAp9TarWDtfJvKPM= > =dsJ1 > -----END PGP SIGNATURE----- > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -- Anatoly Bubenkov -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas at pelme.se Mon Jan 19 21:31:59 2015 From: andreas at pelme.se (Andreas Pelme) Date: Mon, 19 Jan 2015 21:31:59 +0100 Subject: [pytest-dev] FOSDEM / Saturday pytest meetup in Bruxelles In-Reply-To: <20150119202430.GI12060@merlinux.eu> References: <20150119202430.GI12060@merlinux.eu> Message-ID: <92063FD4-D771-4DE0-9BEA-9915F0131180@pelme.se> Hi, I will be there too, looking forward to seeing you all! Cheers, Andreas > On 19 jan 2015, at 21:24, holger krekel wrote: > > Hi folks, > > as some of you know some pytest devs are going to meet at FOSDEM > in Bruxelles end of the month. ASFAIK, Anatoly Bubenkoff, Brianna Laugher, > Floris Bruynooghe and me are bound to come, anyone else? > > During our meetup i'd like to discuss and work on finalizing > https://bitbucket.org/pytest-dev as the new place for pytest core, py, > pytest-xdist, pytest-cache, ..., tox, repositories and using a unified > contribution process for all of them. > > I'd also like to discuss going for a little crowd-funding project that > automates testing and releasing pytest-dev packages including pushing docs > to the respective sites. Bruno Oliveira has already done some work > for visualizing the pytest-plugin status against the latest pytest release > which can probably be re-used http://pytest.org/latest/plugins_index/index.html > > As to the location at FOSDEM, I suggest to meetup 4pm around the > Python FOSDEM room: http://python-fosdem.org/#location > I'll probably be there during the day but also have some other > appointments so can't guarantee that. I'll arrive friday evening > but will probably directly go to Pieter Hintjens's flat and only arrive > saturday morning at the conf site. > > best, > holger > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev From flub at devork.be Tue Jan 20 21:20:27 2015 From: flub at devork.be (Floris Bruynooghe) Date: Tue, 20 Jan 2015 20:20:27 +0000 Subject: [pytest-dev] FOSDEM / Saturday pytest meetup in Bruxelles In-Reply-To: <20150119202430.GI12060@merlinux.eu> References: <20150119202430.GI12060@merlinux.eu> Message-ID: Hi Holger, everyone, On 19 January 2015 at 20:24, holger krekel wrote: > During our meetup i'd like to discuss and work on finalizing > https://bitbucket.org/pytest-dev as the new place for pytest core, py, > pytest-xdist, pytest-cache, ..., tox, repositories and using a unified > contribution process for all of them. > > I'd also like to discuss going for a little crowd-funding project that > automates testing and releasing pytest-dev packages including pushing docs > to the respective sites. Bruno Oliveira has already done some work > for visualizing the pytest-plugin status against the latest pytest release > which can probably be re-used > http://pytest.org/latest/plugins_index/index.html > Sounds good. > As to the location at FOSDEM, I suggest to meetup 4pm around the > Python FOSDEM room: http://python-fosdem.org/#location > Just to be clear, this is Saturday 4pm right? See you all in two weeks time! Floris -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Tue Jan 20 21:47:44 2015 From: holger at merlinux.eu (holger krekel) Date: Tue, 20 Jan 2015 20:47:44 +0000 Subject: [pytest-dev] FOSDEM / Saturday pytest meetup in Bruxelles In-Reply-To: References: <20150119202430.GI12060@merlinux.eu> Message-ID: <20150120204744.GV12060@merlinux.eu> On Tue, Jan 20, 2015 at 20:20 +0000, Floris Bruynooghe wrote: > Hi Holger, everyone, > > On 19 January 2015 at 20:24, holger krekel wrote: > > > During our meetup i'd like to discuss and work on finalizing > > https://bitbucket.org/pytest-dev as the new place for pytest core, py, > > pytest-xdist, pytest-cache, ..., tox, repositories and using a unified > > contribution process for all of them. > > > > I'd also like to discuss going for a little crowd-funding project that > > automates testing and releasing pytest-dev packages including pushing docs > > to the respective sites. Bruno Oliveira has already done some work > > for visualizing the pytest-plugin status against the latest pytest release > > which can probably be re-used > > http://pytest.org/latest/plugins_index/index.html > > > > Sounds good. > > > > As to the location at FOSDEM, I suggest to meetup 4pm around the > > Python FOSDEM room: http://python-fosdem.org/#location > > > > Just to be clear, this is Saturday 4pm right? yes, saturday Jan 31st. holger > > See you all in two weeks time! > Floris From ribalkin at gmail.com Tue Jan 20 23:42:51 2015 From: ribalkin at gmail.com (Boris Ribalkin) Date: Tue, 20 Jan 2015 22:42:51 +0000 Subject: [pytest-dev] fail on zero tests found Message-ID: Is it possible to implement this in py.test: https://bitbucket.org/hpk42/pytest/issue/662/fail-on-zero-tests-found Basically fail by default if pytest cannot find any test, no good anyway :) Thanks -- Boris Rybalkin ribalkin at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Wed Jan 21 04:58:05 2015 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 21 Jan 2015 01:58:05 -0200 Subject: [pytest-dev] fail on zero tests found In-Reply-To: References: Message-ID: I like this change, as long as the return code is different than a normal test suite failure: I can see use cases where automated tools would like to easily distinguish between "failing tests" and "empty suite found". Cheers, Bruno. On Tue, Jan 20, 2015 at 8:42 PM, Boris Ribalkin wrote: > Is it possible to implement this in py.test: > https://bitbucket.org/hpk42/pytest/issue/662/fail-on-zero-tests-found > > Basically fail by default if pytest cannot find any test, no good anyway :) > > Thanks > -- > Boris Rybalkin > ribalkin at gmail.com > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aasraoui at gmail.com Mon Jan 26 02:15:57 2015 From: aasraoui at gmail.com (Abdelillah Asraoui) Date: Sun, 25 Jan 2015 17:15:57 -0800 Subject: [pytest-dev] pytest script sample Message-ID: 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aasraoui at gmail.com Tue Jan 27 21:31:18 2015 From: aasraoui at gmail.com (Abdelillah Asraoui) Date: Tue, 27 Jan 2015 12:31:18 -0800 Subject: [pytest-dev] pytest script sample In-Reply-To: References: Message-ID: 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 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lpbrac at dolby.com Tue Jan 27 21:59:22 2015 From: lpbrac at dolby.com (Brack, Laurent P.) Date: Tue, 27 Jan 2015 20:59:22 +0000 Subject: [pytest-dev] pytest script sample In-Reply-To: References: Message-ID: 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 > 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 > 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 https://mail.python.org/mailman/listinfo/pytest-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From encukou at gmail.com Tue Jan 27 23:07:27 2015 From: encukou at gmail.com (Petr Viktorin) Date: Tue, 27 Jan 2015 23:07:27 +0100 Subject: [pytest-dev] pytest script sample In-Reply-To: References: Message-ID: Hello, We had exactly this problem at work. I used Paramiko to connect to the remote machines, then made openssh (i.e. shelling out to ssh) an option too. When we moved to pytest, I tore this out into a stand-alone plugin ? https://github.com/encukou/pytest-multihost/ Our use cases were a bit more complex, so the configuration isn't very straightforward, but maybe you will find the plugin useful. On Tue, Jan 27, 2015 at 9:59 PM, Brack, Laurent P. wrote: > 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 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 > 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 > https://mail.python.org/mailman/listinfo/pytest-dev > > > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > From schettino72 at gmail.com Thu Jan 29 19:36:47 2015 From: schettino72 at gmail.com (Eduardo Schettino) Date: Fri, 30 Jan 2015 02:36:47 +0800 Subject: [pytest-dev] pytest github organization is taken In-Reply-To: References: <20140801081548.GW7481@merlinux.eu> Message-ID: Hi, I can see a group was created on github[1] but no further information? I am planning to move my plugin[1] to github... can I join the organization? how it works? My github id is schettino72. [1] https://github.com/pytest-dev [2] https://pypi.python.org/pypi/pytest-incremental regards, eduardo -------------- next part -------------- An HTML attachment was scrubbed... URL: From bubenkoff at gmail.com Thu Jan 29 23:09:36 2015 From: bubenkoff at gmail.com (Anatoly Bubenkov) Date: Thu, 29 Jan 2015 23:09:36 +0100 Subject: [pytest-dev] pytest github organization is taken In-Reply-To: References: <20140801081548.GW7481@merlinux.eu> Message-ID: I'll add you On Jan 29, 2015 7:37 PM, "Eduardo Schettino" wrote: > Hi, > > I can see a group was created on github[1] but no further information? > > I am planning to move my plugin[1] to github... can I join the > organization? how it works? > My github id is schettino72. > > [1] https://github.com/pytest-dev > [2] https://pypi.python.org/pypi/pytest-incremental > > regards, > eduardo > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: