In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Usage scenario: test B can be effectively carried out only after Test A has passed successfully.
Use this plug-in to mark a test as a dependency on other test, and those test that depend on it will be skipped when the execution of the dependency fails.
-example above:
Installation: pytest-dependency
Pip install pytest-dependency
Use:
Import pytest@pytest.mark.dependency () def test_01 (test): assert False@pytest.mark.dependency (depends= ["test_01"]) def test_02 (test): print ("execute Test 2")
Take a look at the results:
Test_01 is a dependency of test_02, so after test_01 fails, test_02 is skipped
Conclusion:
1. Install the plug-in first
2. The way to use it is to mark the dependent method with @ pytest.mark.dependency () and use @ pytest.mark.dependency (depends= ["test_name"]) to refer to the dependency.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.