pytest运行报错AttributeError: 'Function' object has no attribute 'get_marker'
代码如下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
=================================== 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就没事 求助大佬 解决的了 pytest_remotedata版本 相对 pytest版本过低导致的
页:
[1]