TA的每日心情 | 奋斗 2020-12-31 15:38 |
---|
签到天数: 196 天 连续签到: 1 天 [LV.7]测试师长
|
代码如下
- from selenium import webdriver
- import random
- import pytest
- class Test_restart(object):
- @pytest.fixture(scope="function", autouse=True)
- def setUp(self):
- global dr
- dr = webdriver.Chrome('D:\\chromedriver456.exe')
- yield
- dr.quit()
- def test_one(self):
- assert random.randint(1, 3) == 3
- dr.maximize_window()
- dr.get('https://www.baidu.com/')
- dr.implicitly_wait(3)
复制代码
运行就会报错,日志如下
- Test_restart.py E [100%]
- =================================== ERRORS ====================================
- ___________________ ERROR at setup of Test_restart.test_one ___________________
- item = <Function test_one>
- def pytest_runtest_setup(item):
-
- > remote_data = item.get_marker('remote_data')
- E AttributeError: 'Function' object has no attribute 'get_marker'
- d:\python3\lib\site-packages\pytest_remotedata\plugin.py:59: AttributeError
- ============================== 1 error in 0.35s ===============================
复制代码
pytest 5.1.1 ,用3.10.1就没事 求助大佬 |
|