ManderaGeneral / generalimport

Handle all your optional dependencies with a single call!
https://pypi.org/project/generalimport/
Apache License 2.0
15 stars 1 forks source link

Unintentional test skips #40

Open Mandera opened 1 year ago

Mandera commented 1 year ago

Sometimes a failing test will raise our custom exception which will skip the test, which will hide the actual problem.

Would be nice to be able to decorate something like this

from typing import Optional
from generalimport import *
from generalimport.test.funcs import ImportTestCase

class Test(ImportTestCase):
    @ensure_not_skipped
    def test_type_with_module(self):
        generalimport("fakepackage")
        import fakepackage

        def my_function1(something: Optional[fakepackage]):
            pass

        my_function1(1)