Skip to content

Cannot use env vars from within functions #22

@aksdb

Description

@aksdb

Example:

###env
base_url = 'http://localhost:8080'
session_id = 'myid'

def apicall(path):
	return "{}{};jsessid={}".format(base_url, path, session_id)
###env

# Profile
get(apicall("/api/foo"))

The call fails because base_url and session_id are empty in the defined function. Declaring them nonlocal doesn't help. How can this be accomplished without duplicating the constants?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions