Python 即使在成功执行代码之后,pytest仍然表示为空套件,并且不打印打印语句
我正在尝试使用import从pytest中的不同模块运行一个方法。它运行正常,但在报告中显示为空套件。不是打印打印报表 roboForm.py-Python 即使在成功执行代码之后,pytest仍然表示为空套件,并且不打印打印语句,python,python-3.x,automation,Python,Python 3.x,Automation,我正在尝试使用import从pytest中的不同模块运行一个方法。它运行正常,但在报告中显示为空套件。不是打印打印报表 roboForm.py- import unittest from selenium import webdriver from selenium.webdriver.support.select import Select class Roboform(unittest.TestCase): def setUp(self): # create a ne
import unittest
from selenium import webdriver
from selenium.webdriver.support.select import Select
class Roboform(unittest.TestCase):
def setUp(self):
# create a new Chrome session
self.driver = webdriver.Chrome()
self.driver.implicitly_wait(10)
self.driver.maximize_window()
self.driver.get("https://www.roboform.com/filling-tests")
def click_Custom_Form(self):
# get the xpath of the link and page
title = self.driver.title
assert title== "RoboForm Form Filling Tests"
print("We are on the right page")
#click on custom form link
self.custom_form = self.driver.find_element_by_xpath("//*[contains(text(),'Custom')]").click()
def close_browser(self):
self.driver.quit()
我正在pytest-test_classB.py中运行以下代码
import self as self
from roboForm import Roboform
class Test():
Roboform.setUp(self)
print ("Browser and page launched from RoboForm")
self.driver.find_element_by_xpath("//*[contains(text(),'Custom')]").click()
print ("Test Passed")
Roboform.close_browser(self)
获取以下错误:
========================================在11.53秒内没有运行任何测试========================
进程已完成,退出代码为0
空套房
空套房同意@Corey Goldberg 试一试 反而
def click_Custom_Form(self):
问题相关信息(包括更新)属于问题,不属于评论。更新您的问题,不要将其作为注释。@错误语法自责。谢谢您。更新了帖子。您的Roboform类不包含任何测试
def click_Custom_Form(self):