Documentation ¶
Overview ¶
Package python facilitates integration testing against Python scripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Args ¶
func Args(f ...string) integration.Option
Args sets additional command line args to be passed to the script (ie. after the script name). If you want to pass arguments to the python process (before the script name) use integration.Args.
func ConfigFile ¶
func ConfigFile(cfg Config) integration.Option
ConfigFile is an option that can be used to write a temporary config file. It is used to pass the connection parameters to the Python side of the tests.
func Import ¶
func Import(class, script string) integration.Option
Import causes the given script to be written out to the working directory and the class name in that script to be imported by the main test runner and executed.
func Test ¶
func Test(ctx context.Context, t *testing.T, opts ...integration.Option) integration.SubtestRunner
Test starts a Python script and returns a function that runs subtests using t.Run. Multiple calls to the returned function will result in uniquely named subtests. When all subtests have completed, the daemon is stopped.