Skip to content
Advertisement

Pytest create multiple files with tmp_path fixture

I have a simple function which counts the files in a directory.

JavaScript

I want to test this the following way. This works, but is of course very repetetive:

JavaScript

Is there an easier way to write this?

Desired:

JavaScript

Advertisement

Answer

Try just a simple for loop like

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement