第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 pytest 運行單元測試時出錯 - AttributeError:

使用 pytest 運行單元測試時出錯 - AttributeError:

繁星coding 2023-02-22 15:08:02
我正在使用 pytest 5.4.1 和 python 3.6代碼:import unittestclass TestStringMethods(unittest.TestCase):    def test_upper(self):        self.assertEqual('foo'.upper(), 'FOO')if __name__ == '__main__':    unittest.main()運行報pytest如下錯誤:Testing started at 06:08 ...Launching pytest with arguments E:/Folder1/Project1/src/Project1.Api/tests/test1.py in E:\Folder1\Project1\src\Project1.Api\tests============================= test session starts =============================platform win32 -- Python 3.6.5, pytest-5.4.1, py-1.5.3, pluggy-0.13.1 -- C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\python.execachedir: .pytest_cacherootdir: E:\Folder1\Project1\src\Project1.Api\testsplugins: arraydiff-0.2, cov-2.8.1, doctestplus-0.1.3, openfiles-0.3.0, remotedata-0.2.1collecting ... collected 1 itemtest1.py::TestStringMethods::test_upper ERROR                            [100%]test setup faileditem = <TestCaseFunction test_upper>    def pytest_runtest_setup(item):    >       remote_data = item.get_marker('remote_data')E       AttributeError: 'TestCaseFunction' object has no attribute 'get_marker'c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages\pytest_remotedata\plugin.py:59: AttributeError可能是什么問題?
查看完整描述

2 回答

?
一只名叫tom的貓

TA貢獻1906條經(jīng)驗 獲得超3個贊

問題是get_marker已經(jīng)改名了get_closest_marker 。在GitHub 上的這個問題中,您可以看到 @arvindpdmn 建議升級pytest-remotedata==0.3.0pytest-remotedata==0.3.2,因此假設您用于pip安裝依賴項,請運行以下命令:

pip install -U pytest-remotedata


查看完整回答
反對 回復 2023-02-22
?
至尊寶的傳說

TA貢獻1789條經(jīng)驗 獲得超10個贊

如錯誤輸出所示,問題出在 pytest-remotedata 包中。

AttributeError: 'TestCaseFunction' object has no attribute 'get_marker'
c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages\pytest_remotedata\plugin.py:59: AttributeError

pytest-remotedata將軟件包升級到最新版本 (0.3.2)后錯誤得到解決:

pip install --upgrade pytest-remotedata


查看完整回答
反對 回復 2023-02-22
  • 2 回答
  • 0 關注
  • 625 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號