vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

allow cassette operations without decorator

Open cfal opened this issue 2 years ago • 0 comments

hi, i'm interested in using vcrpy for recording our http interactions across functions. right now it looks like all of the patching functionality can only be activated by CassetteContextDecorator, so we're doing the following:

def start_recording(self):
  self.cassette = Cassette.use(...)
  self.cassette.__enter__()

def stop_recording(self):
  self.cassette.__exit__()

this isn't a big deal, but was wondering whether it would it be possible to support this kind of pattern without relying on the context functions, or is there already a better way to do this?

thank you!

cfal avatar Mar 10 '22 12:03 cfal