mercredi 17 janvier 2018

Structuring pytest fixtures that write to DynamoDB

I have a bunch of pytest fixtures that write data to dynamodb, yield, and then delete the data. however, this kills the modularity of the fixtures - i'd like to be able to define a new one that's a slight modification of an existing one, but since the existing one includes the write to dynamo, i either end up writing twice, or duplicating code.

I thought a reasonable solution would be building up the data modularly in the fixtures, and then use a final fixture to write the data to dynamo. But there doesn't seem to be any way to control which fixture goes last.

Is there a clean way to achieve this?

Aucun commentaire:

Enregistrer un commentaire