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

provide dependency marks #74

Open
thirtytwobits opened this issue Nov 8, 2019 · 0 comments
Open

provide dependency marks #74

thirtytwobits opened this issue Nov 8, 2019 · 0 comments

Comments

@thirtytwobits
Copy link
Owner

thirtytwobits commented Nov 8, 2019

allow tests to declare ordering dependencies on other tests. For example, if test 'a' assumes you've modified the state of a fixture in 'b', require that test 'b' was run in the current session and was successful if a request to run test 'a' is found. This should be handled both by ensuring correct ordering in the pytest_collection_modifyitems hook and by ensuring that filters do not trim require prerequisites.

While one may argue that each test should work in isolation some hardware tests can take a very long time to run. Repeating such steps to ensure the attached hardware is in the correct state can become onerous.

Here's a hypothetical example: a linux computer requires that an OS image is freshly installed. Subsequent tests may pollute the installed environment so each test session starts with a fresh image. Reinstalling linux for every test would (in our hypothetical example) add hours to a test suite that would otherwise complete in 30 minutes. Instead we allow each test to assert something like @pytest.mark.after_success_of('test_install_linux')

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

No branches or pull requests

1 participant