本文整理汇总了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