Comment

Comment by masklinn

    @pytest.fixture
    def libfact():
        yield CDLL("./fact.so")
FWIW that's pretty confusing as it gives the impression the library is reloaded for every test, but iirc dlopen() will just return a handle to the existing one. I don't think ctypes has a good way to unload dlls so it should probably be `fixture(scope='session')`.

That gets more relevant when on-the-fly compilation is added to the mix, spawning a compiler for every test is a complete waste of time.

parent masklinn 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton