Open sigmavirus24 opened 9 years ago
So, we'd probably have to use pylockfile
to ensure we don't update the same cassette twice. That would probably give us 90% of what we need. Namely, this would be great for the case where we are testing an application that's sharing a session between threads. Even though this isn't a recommendation requests makes, Betamax should still attempt to support it.
Further, I think the dependency on pylockfile
should be optional that could be installed from an extra for betamax, e.g., pip install betamax[threadsafe]
.
The code to integrate this with the current Cassette class should be minimal.
I'm wondering if there's a need to test items using requests in thread-safe manner and how that would work with betamax. Currently the access to cassette files is not threadsafe and I'm wondering what would be necessary to ensure thread-safety.