How do you specify the only test to run with pytest k parameter?2019 Community Moderator ElectionHow do you split a list into evenly sized chunks?How do you change the size of figures drawn with matplotlib?How to return multiple values from a function?How do you read from stdin?Python progression path - From apprentice to guruHow do you append to a file in Python?How do I configure PyCharm to run py.test tests?pg_config executable not foundPyTest doesn't run any testUsual pytest workflow - can't run tests in a file

How to explain that I do not want to visit a country due to personal safety concern?

Most cost effective thermostat setting: consistent temperature vs. lowest temperature possible

My adviser wants to be the first author

Python if-else code style for reduced code for rounding floats

Is "upgrade" the right word to use in this context?

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Do the common programs (for example: "ls", "cat") in Linux and BSD come from the same source code?

Book about superhumans hiding among normal humans

Recruiter wants very extensive technical details about all of my previous work

Did Ender ever learn that he killed Stilson and/or Bonzo?

Do I need to be arrogant to get ahead?

Why do newer 737s use two different styles of split winglets?

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Tikz picture of two mathematical functions

World War I as a war of liberals against authoritarians?

Is it insecure to send a password in a `curl` command?

Describing a chess game in a novel

How could a scammer know the apps on my phone / iTunes account?

How to terminate ping <dest> &

Are Roman Catholic priests ever addressed as pastor

How to pronounce "I ♥ Huckabees"?

Can I use USB data pins as power source

What is the significance behind "40 days" that often appears in the Bible?

Meme-controlled people



How do you specify the only test to run with pytest k parameter?



2019 Community Moderator ElectionHow do you split a list into evenly sized chunks?How do you change the size of figures drawn with matplotlib?How to return multiple values from a function?How do you read from stdin?Python progression path - From apprentice to guruHow do you append to a file in Python?How do I configure PyCharm to run py.test tests?pg_config executable not foundPyTest doesn't run any testUsual pytest workflow - can't run tests in a file










0















I've tried the following:



python -m pytest ./subfolder -k 'test_common_fields'



This doesn't work at all. It finds nothing but this test exists in that subfolder's file of the same name 'subfolder/test_subfolder.py'



I tried entering full path: -k 'subfolder/test_subfolder.py::test_common_fields' and without "subfolder" path. Nothing.










share|improve this question






















  • python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

    – suicidalteddy
    Mar 7 at 15:25











  • no it turns out i didn't need single quotes.

    – Dexter
    Mar 7 at 17:39






  • 1





    @Dexter ah, you're on windows using cmd.exe?

    – Anthony Sottile
    Mar 9 at 17:12















0















I've tried the following:



python -m pytest ./subfolder -k 'test_common_fields'



This doesn't work at all. It finds nothing but this test exists in that subfolder's file of the same name 'subfolder/test_subfolder.py'



I tried entering full path: -k 'subfolder/test_subfolder.py::test_common_fields' and without "subfolder" path. Nothing.










share|improve this question






















  • python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

    – suicidalteddy
    Mar 7 at 15:25











  • no it turns out i didn't need single quotes.

    – Dexter
    Mar 7 at 17:39






  • 1





    @Dexter ah, you're on windows using cmd.exe?

    – Anthony Sottile
    Mar 9 at 17:12













0












0








0








I've tried the following:



python -m pytest ./subfolder -k 'test_common_fields'



This doesn't work at all. It finds nothing but this test exists in that subfolder's file of the same name 'subfolder/test_subfolder.py'



I tried entering full path: -k 'subfolder/test_subfolder.py::test_common_fields' and without "subfolder" path. Nothing.










share|improve this question














I've tried the following:



python -m pytest ./subfolder -k 'test_common_fields'



This doesn't work at all. It finds nothing but this test exists in that subfolder's file of the same name 'subfolder/test_subfolder.py'



I tried entering full path: -k 'subfolder/test_subfolder.py::test_common_fields' and without "subfolder" path. Nothing.







python pytest






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 15:17









DexterDexter

3,21586086




3,21586086












  • python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

    – suicidalteddy
    Mar 7 at 15:25











  • no it turns out i didn't need single quotes.

    – Dexter
    Mar 7 at 17:39






  • 1





    @Dexter ah, you're on windows using cmd.exe?

    – Anthony Sottile
    Mar 9 at 17:12

















  • python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

    – suicidalteddy
    Mar 7 at 15:25











  • no it turns out i didn't need single quotes.

    – Dexter
    Mar 7 at 17:39






  • 1





    @Dexter ah, you're on windows using cmd.exe?

    – Anthony Sottile
    Mar 9 at 17:12
















python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

– suicidalteddy
Mar 7 at 15:25





python -m pytest ./subfolder/test_subfolder.py -k 'test_common_fields' does this work?

– suicidalteddy
Mar 7 at 15:25













no it turns out i didn't need single quotes.

– Dexter
Mar 7 at 17:39





no it turns out i didn't need single quotes.

– Dexter
Mar 7 at 17:39




1




1





@Dexter ah, you're on windows using cmd.exe?

– Anthony Sottile
Mar 9 at 17:12





@Dexter ah, you're on windows using cmd.exe?

– Anthony Sottile
Mar 9 at 17:12












1 Answer
1






active

oldest

votes


















1














On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047163%2fhow-do-you-specify-the-only-test-to-run-with-pytest-k-parameter%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py






    share|improve this answer



























      1














      On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py






      share|improve this answer

























        1












        1








        1







        On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py






        share|improve this answer













        On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 12 at 22:28









        Kiran VemuriKiran Vemuri

        7151934




        7151934





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid …


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047163%2fhow-do-you-specify-the-only-test-to-run-with-pytest-k-parameter%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page