[Openstack] [Swift] Running individual unit tests

Shrinand Javadekar shrinand at maginatics.com
Wed Dec 11 18:25:02 UTC 2013


Thanks a lot Paul, Fabien. This is useful.

On Wed, Dec 11, 2013 at 9:49 AM, Fabien Boucher
<fabien.boucher at enovance.com> wrote:
> Hi,
>
> You can even append the Test class and the method you want to test
> like that :
> nosetests test/unit/proxy/test_server.py:TestAccountController.test_HEAD
> Useful to only focus on one test that fail.
>
> Cheers,
>
> Fabien Boucher
> OpenStack Engineer
> eNovance SaS - 10 rue de la Victoire 75009 Paris - France
>
> ----- Original Message -----
> From: "Paul E Luse" <paul.e.luse at intel.com>
> To: "Shrinand Javadekar" <shrinand at maginatics.com>, openstack at lists.openstack.org
> Sent: Wednesday, December 11, 2013 3:49:15 PM
> Subject: Re: [Openstack] [Swift] Running individual unit tests
>
> Here's what I do:
>
> nosetests --nocapture --nologcapture test/unit/obj/test_diskfile.py
>
> thx
> Paul
>
> -----Original Message-----
> From: Shrinand Javadekar [mailto:shrinand at maginatics.com]
> Sent: Wednesday, December 11, 2013 1:17 AM
> To: openstack at lists.openstack.org
> Subject: [Openstack] [Swift] Running individual unit tests
>
> I thought I must have been asked before, but couldn't find any reference to it. So here it goes:
>
> I have cloned the git repository for Swift locally (on MacOS). I wanted to play with some code and see if it breaks any unit tests.
> When I run tox -e py27, the entire test suite is executed. What's the best way to run a single test or maybe tests from a single class?
>
> Specifically, I was trying to run the DiskFile unit tests? I tried running:
>
> $ tox -e py27 -- test.unit.obj.test_diskfile.TestDiskFile and $ tox -e py27 -- test.unit.obj.test_diskfile
>
> But none of the above worked. They always executed the entire test-suite.
>
> Thanks in advance.
> -Shri
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack




More information about the Openstack mailing list