我想为用户注册实施一个推荐计划,并希望将推荐人信息存储为 Cognito 中的自定义属性。我正在使用 Amplify SDK 来实现同样的目的。
我能够存储自定义登录的自定义属性(使用电子邮件地址和密码),但如何使用“Google”和“Facebook”等社交媒体登录来实现相同的功能?
amazon-web-services amazon-cognito amazon-cognito-facebook amazon-cognito-triggers
我想将输入作为命令行选项传递给pytest文件。这个问题/sf/answers/2950192311/很有帮助,但我不知道要添加多个解析器采用。
我尝试将其添加到我的conftest.py文件中,但没有帮助:
def pytest_addoption(parser):
"""
This function is used to extract input1 and input2 values from the command line
"""
parser.addoption(
"--input1", action="store", default="input1"
)
parser.addoption(
"--input2", action="store", default="input2"
)
Run Code Online (Sandbox Code Playgroud)
我的test.py文件的内容:
import pytest
@pytest.fixture()
def get_input1(input1):
print 'input1:', input1
return input1
# @pytest.mark.unit
@pytest.fixture()
def get_input2(input2):
print 'input2:', input2
return input2
def test_hello(get_input1, get_input2):
print 'testing pytest fixtures with command line options'
print get_input1, get_input2
Run Code Online (Sandbox Code Playgroud)
这是我运行test.py文件的命令:
py.test test.py --input1="hello" --input2="world"
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息:
@pytest.fixture()
def get_input1(input1): …
Run Code Online (Sandbox Code Playgroud)