-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
VCR Fix for debug_code_challenge_a #3926
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
Fantastic! |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
A bajilion years later. This appears to work. |
You must manually remove the existing vcrpy lib though, so we will need to figure out why that is and how to mitigate that going forward |
nums = [2, 7, 11, 15] | ||
target = 9 | ||
result = two_sum(nums, target) | ||
print(result) # Output: [0, 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't tell it what the expected output is, as otherwise the agent might simplify this to just be print('[0, 1]')
|
||
with contextlib.suppress(SystemExit): | ||
create_code_agent.start_interaction_loop() | ||
assert "[0, 1]" in execute_python_file(file_path), "Expected the output to be [0, 1]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this doesn't appear to be executing.
I have a file that was re-written to print('Hello World')
And this still appears to be passing.
I'm about to get on a plane. But if you could debug that that'd be sweet
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Already picked up in another PR according to Wayne. Closing :) |
Background
When using @pytest.vcr.mark, and then using docker, the test hangs as vcr intercepts the docker call, and is stuck inside an infinite loop. This is due to the vcr library checking if the instance is part of the vcr class, and if it isn't it's stuck inside a while loop. The test is from @merwanehamadi
Changes
I modified the vcr library to skip the while loop if the instance is docker. This prevents the hang, and tests using @pytest.vcr.mark work correctly now. As a result, I modified requirements.txt to use my slightly modified version of vcr with the fix, find pr here: kevin1024/vcrpy#692
Documentation
The test comes from @merwanehamadi, and I modified the vcrpy library to allow @pytest.mark.vcr to work without hanging the test.
Test Plan
I have tested the test with my version of vcrpy, and everything works perfectly.
PR Quality Checklist
I have not added tests as all I have done is fix the vcr hanging issue, which will not affect the functionality of vcr if the instance is not docker.