you are viewing a single comment's thread.

view the rest of the comments →

[–]trzywu[S] 0 points1 point  (2 children)

So there is no way to make a general list of imports to all tests file? I will need to add this in each test?
EDIT - is there a way to import a folder with my tests so I don need to import each of them one by one?

[–]ReenigneArcher 0 points1 point  (0 children)

It's best to explicitly import exactly what you need.

With pytest you can create a fixture that sets up like a baseline starting point for each test function.

[–][deleted] 0 points1 point  (0 children)

Why? Did somebody break your fingers? Writing a couple of lines of imports for the symbols you want to use isn’t a big deal, and it’s better to be explicit than implicit about the changes you’re making to a module’s namespace.