Pytest在终端上找到test,但不在pycharm上找到

rbl8hiat  于 2023-03-12  发布在  PyCharm
关注(0)|答案(1)|浏览(110)

当我在pycharm上运行pytest时,点击“运行”按钮,而它被设置为在当前文件上运行。它没有找到测试。但是当我在终端上运行pytest时,它找到了测试。Pycharm为我工作,直到我重新启动我的PC
文件名为:'测试检验客户用户.py'

import pdb
import pytest
from frameweerk.src.pages.homepage import homepage
from frameweerk.src.pages.Header import Header

@pytest.mark.usefixtures('init_driver')
class TestEndtoendchekoutguestuser:

    @pytest.mark.tcid33
    def test_end_to_end_checkout_guest_user(self):
     home_p= homepage(self.driver)
     header= Header(self.driver)



     home_p.go_to_home_page()

     home_p.click_first_add_to_cart_button()



     header.click_on_cart_header()

     pdb.set_trace()

尝试在pycharm上运行pytest,但未找到测试。在终端上运行,但找到了测试

yfjy0ee7

yfjy0ee71#

在PyCharm中导航至Settings-〉Tools-〉Python Integrated Tools
Testing部分中,检查Default test runner的选定选项-应为pytest

相关问题