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

Make _cassette_name a part of API #175

Open
jirikuncar opened this issue Sep 10, 2019 · 4 comments
Open

Make _cassette_name a part of API #175

jirikuncar opened this issue Sep 10, 2019 · 4 comments

Comments

@jirikuncar
Copy link
Contributor

Rename _ca(s)sette_name helper function to cassette_name to be a part of the API.

@sigmavirus24
Copy link
Collaborator

Why?

@jirikuncar
Copy link
Contributor Author

I am using it to define more advanced fixtures. I could try to make the current fixtures more configurable but it will complicate the codebase.

@sigmavirus24
Copy link
Collaborator

I genuinely don't understand your use case. What does "more advanced fixtures" mean?

@jirikuncar
Copy link
Contributor Author

I have something along this lines in my client tests:

@pytest.fixture(scope="session")
def recorder():
    import betamax
    import client

    session = client.Client("http://localhost:8000")
    with betamax.Betamax(session) as vrc:
        yield vrc


@pytest.fixture
def session(request, recorder):
    from betamax.fixtures.pytest import _casette_name
    recorder.use_cassette(_casette_name(request, True))

    yield recorder.session

and I would like to make sure that _cas(s)ette_name becomes a public API.

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

2 participants