We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Having an issue in several different scenarios. I will describe one here.
I'm running some tests with pytest, and in this case I'm using a pydantic function, the code is:
def test_something(self, expected_response): self.some_mock.return_value = httpx.Response(200, json=expected_response) result = some_function({}, {}) assert result.model_dump() == expected_response import ipdb; ipdb.set_trace()
this test belongs to a test class, there is a mock definition, and expected_response is a pytest fixture that returns a dictionary.
when i run this, i come here:
321 else: 322 copied.__dict__.update(update) 323 copied.__pydantic_fields_set__.update(update.keys()) 324 return copied 325 --> 326 def model_dump( 327 self, 328 *, 329 mode: Literal['json', 'python'] | str = 'python', 330 include: IncEx = None, ipdb>
but if i comment the line assert result.model_dump() == expected_reponse things work fine:
assert result.model_dump() == expected_reponse
19 20 def test_something(self, expected_response): 21 self.some_mock.return_value = httpx.Response(200, json=expected_response) 22 23 result = some_function({}, {}) ---> 24 import ipdb; ipdb.set_trace() 25 26 27 #assert result.model_dump() == expected_response
this has happened a lot to me lately in different scenarios.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Having an issue in several different scenarios. I will describe one here.
I'm running some tests with pytest, and in this case I'm using a pydantic function, the code is:
this test belongs to a test class, there is a mock definition, and expected_response is a pytest fixture that returns a dictionary.
when i run this, i come here:
but if i comment the line
assert result.model_dump() == expected_reponse
things work fine:this has happened a lot to me lately in different scenarios.
The text was updated successfully, but these errors were encountered: