surrogate icon indicating copy to clipboard operation
surrogate copied to clipboard

Create a function that imports or stubs a module, at the module level

Open cristi-zz opened this issue 3 years ago • 0 comments

Hi! I use this library on embedded/hardware testing scenarios where various hardware libs are not available on regular computers.

I created something similar to https://docs.pytest.org/en/6.2.x/reference.html#pytest-importorskip but instead of skipping the whole test suite, just create a surrogate.

It is a syntax sugaring, getting rid of all the @surrogate before each test case.

Hope it helps!

cristi-zz avatar Sep 17 '21 09:09 cristi-zz