当我在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,但未找到测试。在终端上运行,但找到了测试
1条答案
按热度按时间yfjy0ee71#
在PyCharm中导航至
Settings
-〉Tools
-〉Python Integrated Tools
。在
Testing
部分中,检查Default test runner
的选定选项-应为pytest
。