python - 不会收集班级内的测试
问题描述
我有一个问题,我似乎无法找到解决方法。我有一个基础测试类,我在其中初始化驱动程序,并将其扩展到我的测试,但是,我的其余测试没有被拾取。
这是我的基本测试类
from fbtests.pages import Pages
class BaseTest:
def __init__(self, driver):
self.driver = driver
self.pages = Pages(driver)
print('I do this')
这是我尝试运行的主要测试
from nose.tools import istest
from utils.misc import selenium_testcase
from fbtests.BaseTest import BaseTest
@istest
@selenium_testcase
class SmokeTest(BaseTest):
def test_smoke_homepage_country(self):
print('I dont enter here')
"""Check successful country tests from the homepage
Scenario:
Search and assert country pages through URL
Steps:
1. Go to home page
2. Search state through a URL parameter
3. Assert that the country landing page is visible
"""
# pages = Pages(driver)
list_of_countries = {'us', 'mx', 'mv', 'au', 'bg'}
for country in list_of_countries:
self.pages.home.visit('platform', 'homepage', '/charters/search/' + str(country))
self.test_smoke_homepage_country()
SmokeTest(BaseTest) 被选中,但是 test_smoke_homepage_country 没有。
浏览器只是打开和关闭消息:
2021-08-05 09:38:06,949 -nose.importer - 调试 - 添加路径 /Users/dusandev/miniconda3/envs/orqa/bin fbtests.teams.customer.test_smoke.SmokeTest ...我这样做没问题
在 3.124 秒内运行 1 次测试
好的
在参数下的运行/调试配置中,我有以下内容: run_tests -c config/orqa.yaml fbtests.teams.customer.test_smoke:SmokeTest -v --nocapture
我似乎无法找出为什么它不运行该方法。预先感谢您的帮助。
解决方案
推荐阅读
- apache - 如何解决连接 - 过时的连接设置
- html - 带有徽标和导航的 HTML5/CSS 粘滞页眉
- ios - 使用 NSKeyedUnarchiver unarchivedObject(ofClass:from:) 取消归档数组
- c# - Asp.net 在启动时加载所有 dll,导致 BadImageFormatException
- python - 解释 scipy 区间函数中的 alpha 变量
- ruby-on-rails - rails升级后soundcloud连接中的redirect_uri_mismatch
- django - 测试 Django url 'name' 是正确的 url
- google-app-engine - 使用App Engine golang柔性环境,测试时访问app.yaml
- c++ - 使用 EvtFormatMessage 获取默认字符串
- python - 比较给定列 2×2 值的最佳方法