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

Select tests according to their mark #50

Closed
pytestbot opened this issue Jun 1, 2011 · 7 comments
Closed

Select tests according to their mark #50

pytestbot opened this issue Jun 1, 2011 · 7 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: David Burns (BitBucket: AutomatedTester, GitHub: AutomatedTester)


Currently the only way to sort through tests is with the -k option. Unfortunately this also looks at the method name which can run tests you don't want/expect.

For example

#!python



@pytest.mark.staging
def test_omg_dont_run_on_prod(self):
    pass

@pytest.mark.prod
def test_basics_still_work(self):
    pass


py.test -k prod #Runs the tests above even though the first one is marked as staging

It would be great if we could add a -m option that only looks at the marks.

so if I did py.test -m prod only the second test would be run.


@pytestbot
Copy link
Contributor Author

Original comment by David Burns (BitBucket: AutomatedTester, GitHub: AutomatedTester):


We should also be able to negate marks to not have them included

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


are you still up for offering a patch?

1 similar comment
@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


are you still up for offering a patch?

@pytestbot
Copy link
Contributor Author

Original comment by David Burns (BitBucket: AutomatedTester, GitHub: AutomatedTester):


Yea, I know someone who has just created plugin that we can use to bring it into the core.

@pytestbot
Copy link
Contributor Author

Original comment by David Burns (BitBucket: AutomatedTester, GitHub: AutomatedTester):


Is there anything else that needs to be done with the pull request for this?

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


i added another review on the pull request and don't think the feature is quite finished. There also is the issue of adding a few examples in the docs. I can see to do some of the work myself but i can't tell when i get to it.

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


fix issue50 (add a reference to the already implemented -m) and improve release annoucnement and changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant