Skip to content

Run tests in a module discovery #12243

Answered by nicoddemus
brycegbrazen asked this question in Q&A
Discussion options

You must be logged in to vote

But just to clarify, is it possible to just pass a file basename if you want to run just a single file? Just curious if it will do a recursive search for the file.

Not the filename directly (as @The-Compiler commented), but it is possible to use the -k flag (pytest -k basename) and pytest will collect all files and run only those that contain basename in their "node id".

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@nicoddemus
Comment options

@brycegbrazen
Comment options

@The-Compiler
Comment options

@nicoddemus
Comment options

Answer selected by brycegbrazen
@brycegbrazen
Comment options

@nicoddemus
Comment options

@The-Compiler
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants