Monkeypatching pandas series to_csv with pytest #13087
Unanswered
Tim-Kirkwood
asked this question in
Q&A
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hello,
I am testing a function,
write_query()
, in module.py. My test is in test_module.py, which is carried out using pytest. I am using the pytest monkeypatch fixture to monkeypatchSeries.to_csv()
, in order to prevent file writing. It works in part - my monkeypatched function performs checks that seem to complete, and raises an error that is expected and indicates a passed test (I did this so I could explicitly include a test in the test function, rather than calling the function in a test and have the test performed in the function alone). However, it is still writing a file,doesnt_matter
, and I'm not sure why. Can anyone explain? Please note, I have tried raising this on stack overflow but haven't had much traction. Please let me know if I can provide any more information.Thanks!
Tim
folder/module.py
folder/test_module.py
Beta Was this translation helpful? Give feedback.
All reactions