Skip to content

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

Open
@ubalklen

Description

@ubalklen

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions