Implement "before" and "after" markers
Opened this issue · 3 comments
ftobia commented
Something like:
@pytest.mark.run_before(test_name='test_foo')
def test_bar():
assert True
I welcome ideas for different / better APIs.
ftobia commented
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 commented
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')