Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set environment variables (i.e. config properties) when unit test using Python? #157

Open
shengjun-zh opened this issue Nov 22, 2021 · 0 comments

Comments

@shengjun-zh
Copy link

Refer to the document below, I can do unit test using Python, but I found there is no way to pass the environment variables (i.e. config properties) when calling setup_fn_call().

https://github.com/fnproject/fdk-python#unit-testing-your-functions

@pytest.mark.asyncio
async def test_parse_request_without_data():
    call = await fixtures.setup_fn_call(handler)

    content, status, headers = await call

    assert 200 == status
    assert {"message": "Hello World"} == json.loads(content)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant