Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only decorator #3581

Closed
kharandziuk opened this issue Jun 14, 2018 · 2 comments
Closed

only decorator #3581

kharandziuk opened this issue Jun 14, 2018 · 2 comments
Labels
platform: mac mac platform-specific problem

Comments

@kharandziuk
Copy link

I'm debugging one test which fails. Is there a way to mark only one test to run?

something like:

@pytest.only # it doesn't work
def test_some_test():
  ...

it looks like there is no such feature. is it a kind of design decision? or can I create a pr?

@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #2702 (PY3 only: assumes that argument (from decorator) is a fixture), #129 (Test functions with decorators are collected in wrong order), #697 (Support for the Michele Simionato's 'decorator' module.), #2001 (Using fixture decorator as a function), and #2404 (Class decorator marks multiple classes).

@nicoddemus nicoddemus added the type: question general question, might be closed after 2 weeks of inactivity label Jun 14, 2018
@nicoddemus
Copy link
Member

Hi @kharandziuk,

There are a number of ways:

  1. pytest test_file.py::test_some_test.
  2. pytest -k test_some_test.
  3. Mark the test with @pytest.mark.something and run with pytest -m something.

I suggest to take a look at the documentation for running specific tests.

I'm closing this for now but feel free to follow with further questions.

@pytestbot pytestbot added platform: mac mac platform-specific problem and removed type: question general question, might be closed after 2 weeks of inactivity labels Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: mac mac platform-specific problem
Projects
None yet
Development

No branches or pull requests

3 participants