Use fixture instance in non-test classes #11619
Unanswered
peppe-russo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I'm writing a pytest plugin that uses pytest-vnc as a dependency. The way I use it is to wrap it around my own custom fixture to override the
sleepmethod, like so:I then have an
Areaclass in another file that I use quite often around my plugin, which needs to use thatVNCinstance (or more precisely, theqt_vncfixture), example:The current way I'm doing this is to have an optional
vncfield to theAreaclass and just pass the fixture to it when I instanciate the class, which doesn't look very elegant and it's not always possible as I use this class from places where I can't easily access the fixture.Is there a "proper" way to make the
qt_vncfixture like a global singleton or something like that so I can access it from my custom classes? (TheAreaclass is not the only class that needs to use it).Thanks in advance,
Peppe
Beta Was this translation helpful? Give feedback.
All reactions