qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 2/3] iotests/118: Create test classes dynamicall


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH 2/3] iotests/118: Create test classes dynamically
Date: Thu, 1 Aug 2019 13:53:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 31.07.19 22:42, Kevin Wolf wrote:
> We're getting a ridiculous number of child classes of
> TestInitiallyFilled and TestInitiallyEmpty that differ only in a few
> attributes that we want to test in all combinations.
> 
> Instead of explicitly writing down every combination, let's use a loop
> and create those classes dynamically.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  tests/qemu-iotests/118 | 69 +++++++++++++-----------------------------
>  1 file changed, 21 insertions(+), 48 deletions(-)

Reviewed-by: Max Reitz <address@hidden>

> +            name = '%s_%s_%s' % (case.__name__, media, interface)
> +            globals()[name] = type(name, (case, ), attr)

Äh.  OK.  Well, learned about that (trailing comma) today, I guess.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]