Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check if a cassette is playing back? #102

Open
ubalklen opened this issue Apr 1, 2023 · 0 comments
Open

How to check if a cassette is playing back? #102

ubalklen opened this issue Apr 1, 2023 · 0 comments

Comments

@ubalklen
Copy link

ubalklen commented Apr 1, 2023

I have a fixture and I want it to act differently depending on whether a cassete is playing back or not. Is there a way to check for this?

My first thought was to check the presence of a cassette with the same name of the running test, but I realized there are instances where there is a cassette but it's not playing back (for example, when --record-mode is rewrite or simply when the plugin is deactivated).

In case you're wondering why would I want do that, it's because my code makes some complex network requests using the pywin32 package that can't be done by requests. These requests won't be recorded and that's ok, but I don't want they being triggered when a cassette is playing back, so I intend to monkeypatch them but only in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant