本文整理匯總了Python中nox.parametrize方法的典型用法代碼示例。如果您正苦於以下問題:Python nox.parametrize方法的具體用法?Python nox.parametrize怎麽用?Python nox.parametrize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nox
的用法示例。
在下文中一共展示了nox.parametrize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_add_session_parametrized_noop
# 需要導入模塊: import nox [as 別名]
# 或者: from nox import parametrize [as 別名]
def test_add_session_parametrized_noop():
manifest = Manifest({}, create_mock_config())
# Define a session without any parameters.
@nox.parametrize("param", ())
def my_session(session, param):
pass
my_session.python = None
my_session.venv_backend = None
# Add the session to the manifest.
for session in manifest.make_session("my_session", my_session):
manifest.add_session(session)
assert len(manifest) == 1
session = manifest["my_session"]
assert session.func == _null_session_func
示例2: test_add_session_parametrized
# 需要導入模塊: import nox [as 別名]
# 或者: from nox import parametrize [as 別名]
def test_add_session_parametrized():
manifest = Manifest({}, create_mock_config())
# Define a session with parameters.
@nox.parametrize("param", ("a", "b", "c"))
def my_session(session, param):
pass
func = Func(my_session, python=None)
# Add the session to the manifest.
for session in manifest.make_session("my_session", func):
manifest.add_session(session)
assert len(manifest) == 3
示例3: test_add_session_parametrized_multiple_pythons
# 需要導入模塊: import nox [as 別名]
# 或者: from nox import parametrize [as 別名]
def test_add_session_parametrized_multiple_pythons():
manifest = Manifest({}, create_mock_config())
# Define a session with parameters.
@nox.parametrize("param", ("a", "b"))
def my_session(session, param):
pass
func = Func(my_session, python=["2.7", "3.6"])
# Add the session to the manifest.
for session in manifest.make_session("my_session", func):
manifest.add_session(session)
assert len(manifest) == 4