parametrize_from_file icon indicating copy to clipboard operation
parametrize_from_file copied to clipboard

Add the ability to load values from python files

Open kalekundert opened this issue 4 years ago • 0 comments
trafficstars

The basic idea would be to load the file and then to look in globals() for test cases, e.g.:

test_foo = [
    dict(
        given=1,
        expected=2,
    ),
    dict(
        given=3,
        expected=4,
    ),
    ...
]

test_bar = [
    ...
]

The trick is deciding what default file name to look for. I can't simply use the .py extension, because that would be the same name as the test file. Maybe I could use the _params.py suffix.

kalekundert avatar Mar 19 '21 19:03 kalekundert