Summary
The smoke tests provided in test_smoke.py are not independent, and their success depends on the order in which they are run
Expected Behaviour
The success of a test should be independent of the order in which it is run, and whether it is run in isolation or as part of a suite.
Actual Behaviour
Tests currently succeed only by coincidental choice of running order and specific expectation values
Steps to reproduce:
- Modify
test_single_config so that it asserts that a Debug config is installed (or anything except Release).
- Run
pytest -k test_single_config. The three selected tests should pass:
collected 61 items / 58 deselected / 3 selected
test_smoke.py::TestBasic::test_single_config PASSED [ 33%]
test_smoke.py::TestBasic::test_single_config_only_one_configuration_installed PASSED [ 66%]
test_smoke.py::TestBasic::test_single_config_override_install_config PASSED [100%]
- Move
test_single_config so that it runs after test_single_config_override_install_config
Run the tests again with pytest -k test_single_config. Now test_single_config will fail.
collected 61 items / 58 deselected / 3 selected
test_smoke.py::TestBasic::test_single_config_only_one_configuration_installed PASSED [ 33%]
test_smoke.py::TestBasic::test_single_config_override_install_config PASSED [66%]
test_smoke.py::TestBasic::test_single_config FAILED [100%]
- If
test_single_config is now run in isolation with pytest -k 'test_single_config and not test_single_config_o', it will pass
Summary
The smoke tests provided in
test_smoke.pyare not independent, and their success depends on the order in which they are runExpected Behaviour
The success of a test should be independent of the order in which it is run, and whether it is run in isolation or as part of a suite.
Actual Behaviour
Tests currently succeed only by coincidental choice of running order and specific expectation values
Steps to reproduce:
test_single_configso that it asserts that aDebugconfig is installed (or anything exceptRelease).pytest -k test_single_config. The three selected tests should pass:test_single_configso that it runs aftertest_single_config_override_install_configRun the tests again with
pytest -k test_single_config. Nowtest_single_configwill fail.test_single_configis now run in isolation withpytest -k 'test_single_config and not test_single_config_o', it will pass