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

Implement "before" and "after" markers #6

Open
ftobia opened this issue Mar 18, 2014 · 3 comments
Open

Implement "before" and "after" markers #6

ftobia opened this issue Mar 18, 2014 · 3 comments

Comments

@ftobia
Copy link
Owner

ftobia commented Mar 18, 2014

Something like:

@pytest.mark.run_before(test_name='test_foo')
def test_bar():
    assert True

I welcome ideas for different / better APIs.

@ftobia
Copy link
Owner Author

ftobia commented Mar 27, 2014

I think I like this better:

@pytest.mark.run(before='test_foo')
def test_bar():
    assert True

It's more declarative and it means pytest-ordering can register a single marker that does all the work.

@Bengreen
Copy link

Bengreen commented Jun 29, 2016

I like this concept as it would be much easier to maintain sequence of tests by reference rather than having to specify a static sequence number.
i.e. if i have stuff in a static order using numbers then i need to insert another test in between two others then i have a challenge as i may need to renumber all my tests which makes it hard to maintain tests.

My preference is
@pytest.mark.run(before='test_foo')

@ftobia
Copy link
Owner Author

ftobia commented Oct 9, 2019

Call this marker "order" instead of "run" per #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants