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

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme