-
Notifications
You must be signed in to change notification settings - Fork 62
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
Issue with betamax not recording requests within unconsumed generators #131
Comments
So the problem is that Betamax replaces the original
I wouldn't call it "stupid mistake". I'd label it "common missteps".
I'm not sure what "it" is here. |
Of course not, but I could imagine that a global config option, that adds verbosity to betamax so that within a test context, more output could be thrown at the user:
maybe would it be possible to catch
it is just as an issue in the tracker. |
That's not possible without looking at sys.argv directly and having to check for both py.test and the verbose options (which is kind of gross). Further, Betamax aims to be test framework independent. We ship a pytest fixture, but we also ship fixtures for other popular testing frameworks too. I'm asking in |
@hroncok for what it's worth, I never received any help in |
Let's document this then. "Common mistakes" section sounds great. @guyzmo are you willing to send a PR? |
I can do that, though please point me out which file and where you want the section to be included (basically a |
cf sigmavirus24/github3.py#679
tl;dr
I have setup tests with helpers such as:
in the example above, I'm returning a generator from the helper method. So when in the test I'm transforming it into a list, the iterator runs the generator AFTER the
with statement
has been exited.The fix is simply to run the generator within the
with
block context.possible actions
The text was updated successfully, but these errors were encountered: