-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add session
property to Pill
class
#31
Comments
garnaat
added a commit
that referenced
this issue
Feb 17, 2016
Add a property to pill to retrieve the associated session. Fixes #31.
Makes sense. Added a property to fetch the session. |
Thanks @garnaat , it was really quick (incl. publishing new version to pypi). I tested it with the latest version and it works as expected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to use
placebo
in mypytest
based suite, I have found, that in some scenarions (recording responses) I have forgotten topill.stop()
recording. For this reason my recording test was not failing when it was supposed to (when I disconnected from Internet).For this reason I have decided to use
@pytest.fixture
calledrecording_pill
, which at teardown callspill.stop()
.Anyway, I have found, I need to get the session bound to the pill and the only way to do it now is to ask
pill._session
breaking the rule "we are all adults" and accessed the private property.It would be handy to have (possibly read-only)
session
property on thePill
class.Here is my current test suite
tests/test_logs.py
:I could possibly pass the
session
value intotest_recording
andtest_playback
, but this is tricky as I really want to be sure, it is exactlythe
session
the pill was created for.The text was updated successfully, but these errors were encountered: