Is there a way to dynamically change/substitute one of f-string variables? Let's say I have format as follows: expected = f'{var} {self.some_evaluation_1(var)} {self.some_evaluation_2(var)}' Then I have test case with multiple assertions: var1='some value 1' var2='some value 2' var3='some value 3' var=var1 self.assertEqual('some great value1', expected) var=var2 self.assertEqual('some great value2', expected) var=var3 self.assertEqual('some great value3', expected) Is there a way to make f-string use my variable instead of defined in initial format? # Let's say something like this? It's just a concept I know it doesn't work. self.assertEqual('some great value1', expected % var1) Continue reading...