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

Cassette support for multiprocessing #23

Open
sweenzor opened this issue Oct 3, 2014 · 0 comments
Open

Cassette support for multiprocessing #23

sweenzor opened this issue Oct 3, 2014 · 0 comments

Comments

@sweenzor
Copy link

sweenzor commented Oct 3, 2014

Currently, if you use cassette within a multiprocess created process, it will not save the recorded responses.

Simple example wherein "responses.yaml" is not created

import multiprocessing
import urllib2

import cassette


def hi(*args):

    r = urllib2.urlopen("http://www.internic.net/domain/named.root")
    r = urllib2.urlopen("http://www.internic.net/domain/named.root")

    assert "A.ROOT-SERVERS.NET" in r.read(10000)


if __name__ == '__main__':
    cassette.insert("responses.yaml")

    p = multiprocessing.Process(target=hi)
    p.start()
    p.join()

    cassette.eject()
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