Replies: 1 comment 12 replies
-
Create a own package that fakes the import names Also reach out to the vendor about test automation Some venors provide extra license specifically for development or ci |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using a Python package that is provided by a vendor that makes laboratory equipment. The vendor package provides an interface to control an instrument in the lab. Due to licensing, the vendor package is only on the computer that the instrument is connected to.
I made another Python package that relies on the vender package for some functionality. However, the computer where the vendor package resides is not always accessible which hampers the development of my own package. So the only time I can develop my package is when I have access to the lab computer.
I tried to monkeypatch functions from the vendor package. But it doesn't work because pytest complains that the vendor package can't be found. Below is some code to demonstrate the problem.
Is there a way I can use monkeypatch or some other feature of pytest to run tests for my package when the vendor package is not available? I basically want to mock the vendor package so that I can develop my own package when I don't have access to the computer where the vendor package resides.
Beta Was this translation helpful? Give feedback.
All reactions