Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 12
    Thanks. But if there's a test with the same name in foo.py and bar.py (say test_001), it'll end up executing from both.
    – Sharad
    Commented Apr 11, 2016 at 6:16
  • 3
    yes it will, any thing that matches the pattern will be executed as i have mentioned in the Note
    – supamaze
    Commented Apr 11, 2016 at 6:56
  • 3
    But that's a problem for me. I'd like to choose which tests to execute from which file.
    – Sharad
    Commented Apr 11, 2016 at 7:04
  • btw if you are using PyCharm, you can specify keywords in run configuration of a test
    – tjysdsg
    Commented Aug 9, 2020 at 12:25
  • what will happen if I put test_xxx function in a class called 'TestClass'?
    – stevezkw
    Commented Oct 23, 2023 at 0:35