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
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
add a comment |
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
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
add a comment |
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
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
python pytest
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py
add a comment |
On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py
add a comment |
On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py
On Ubuntu, I generally use py.test --verbose -k testcase_1 test_xyz.py
answered Mar 12 at 22:28


Kiran VemuriKiran Vemuri
7151934
7151934
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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