From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 620A54590E; Thu, 5 Sep 2024 17:24:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D71442E61; Thu, 5 Sep 2024 17:24:48 +0200 (CEST) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id 8944242E5F for ; Thu, 5 Sep 2024 17:24:46 +0200 (CEST) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7d50532d335so433113a12.1 for ; Thu, 05 Sep 2024 08:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725549885; x=1726154685; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mD0Qd4I3UqlCEUYLUzjPbVqXwblqTpVVs8Q19XTHhW8=; b=ZZMxKrhk6vCrgtSNgboBV81dsbQuuLJ4IAn8GQVP/K8ZM8qdV9Of6+Dox9pnIdiTEg dukp7X5YxFHmQlfkZ85Yg3EsTCDjEbnf3K7dtXcNAi35l6fmO7QGPS8pIFF0jtKVOcaB L3qbp4M72g+5xinuaSIAHFT6OLzkf1NYvfHSo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725549885; x=1726154685; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mD0Qd4I3UqlCEUYLUzjPbVqXwblqTpVVs8Q19XTHhW8=; b=Vx9r8899S1Uz7+vL2AAnkNbY5tRqUyQBW1pvme55JHdH9GFKQIHk3E/UgzmWaNEMW9 E93ybP2LbEb1Q1h0O2Vb1Z23RjkVNsoTr+I9xFXPUK+4BkehK7koMy6Jd5sbfVzTH7y5 AEOcPmvu/NbTAjvobcfxQx8aBlr2Unu0cKUagIJ5CT9fYw61JddCysKzDbXvrlnF9HrX LxWOktMyeipMxyitkwbHxT5Sx1vV2OPYfx9HZpG0iYBX6vrKynvqHT9gg1+W6MpfPwN4 Cb0DFfJRlzwEMqEFWXNsIla+HTzruqBlYGeLXlO6pH1OQ6WvhMKMDSJecP3Myec01KA+ Vj/w== X-Forwarded-Encrypted: i=1; AJvYcCU2nX02DdwkekUDHm7TDbXqaEy1oV4BXcZKx1mQSTBh6VusPstRZUaTyCCcEvpXqlwx5sM=@dpdk.org X-Gm-Message-State: AOJu0YyFt9buyp0aGGLe2R8FBSF1dVaCsna19kg6tNcGK4vz6q6YhRwn qQmIU6Y8ud+kvWsBlyWT6lk2MahDvsJk3DdqhJ3bl/E5EUD9CCwCAY4dCK4xgoPz6UyBg0gPpA7 bCAFqZlXmEu1PlXIRPlAylkutJobkLW7Ae+wVfA== X-Google-Smtp-Source: AGHT+IFXRKOytXvlZAgyOG2N7ej/67mO28PjAZKh5Gql611B1N/dxonQ69zjTTMARyqqFpt/LkH80JnTbjaYMpR7nd0= X-Received: by 2002:a17:90b:17cc:b0:2da:8730:5683 with SMTP id 98e67ed59e1d1-2da8730581dmr6661923a91.39.1725549885467; Thu, 05 Sep 2024 08:24:45 -0700 (PDT) MIME-Version: 1.0 References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240821145315.97974-1-juraj.linkes@pantheon.tech> <20240821145315.97974-4-juraj.linkes@pantheon.tech> In-Reply-To: From: Jeremy Spewock Date: Thu, 5 Sep 2024 11:24:34 -0400 Message-ID: Subject: Re: [PATCH v3 03/12] dts: add test case decorators To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, dmarx@iol.unh.edu, alex.chapman@arm.com, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Sep 5, 2024 at 4:07=E2=80=AFAM Juraj Linke=C5=A1 wrote: > > > > On 26. 8. 2024 18:50, Jeremy Spewock wrote: > > On Wed, Aug 21, 2024 at 10:53=E2=80=AFAM Juraj Linke=C5=A1 > > wrote: > > > >> class DTSRunner: > >> @@ -232,9 +231,9 @@ def _get_test_suites_with_cases( > >> > >> for test_suite_config in test_suite_configs: > >> test_suite_class =3D self._get_test_suite_class(test_sui= te_config.test_suite) > >> - test_cases =3D [] > >> - func_test_cases, perf_test_cases =3D self._filter_test_ca= ses( > >> - test_suite_class, test_suite_config.test_cases > >> + test_cases: list[type[TestCase]] =3D [] > > > > If TestCase is just a class, why is the `type[]` in the annotation > > required? Are these not specific instances of the TestCase class? I > > figured they would need to be in order for you to run the specific > > test case methods. Maybe this has something to do with the class being > > a Protocol? > > > > The *_test decorators return type[TestCase]. The functions (test > methods) are cast to type[TestCase] (which kinda makes them subclasses > of TestCase). Oh interesting, I didn't make the connection that casting them to type[TestCase] was similar to having them be subclasses of the type, but this actually makes a lot of sense. Thank you for the clarification! > > This was a suggestion from Luca and I took it as as. Maybe the functions > could be cast as instances of TestCase, but I didn't try that. Right, I would think that they could be cast directly to it, but there's no need obviously so that makes sense. > > >> + func_test_cases, perf_test_cases =3D test_suite_class.get= _test_cases( > >> + test_suite_config.test_cases > >> ) > >> if func: > >> test_cases.extend(func_test_cases) >