Closed tterb closed 5 years ago
@tterb Thanks for reporting. I'll check if I can reproduce this issue on my end and get back to you on this.
@manrajgrover Okay, let me know if more info is needed
@tterb I would need more information here. Could you please create a sample code to reproduce this issue? I tried doing it but couldn't.
Presuming halo runs some cleanup using an atexit
func, this sounds more to me like halo writing to what it thinks is sys.stdout
, but was really pytest's caplog — which presumably is a StringIO long-since closed by the time halo cleans up.
Here ya go (just hit run): https://repl.it/repls/SorrowfulNaturalDisassembler
@theY4Kman Yes, we do have a clean up function that runs atexit
since we would like to stop the thread if it is running and clean up the stream. But since the stream is closed, we should check if the stream is closed before writing anything to it. Is there a better solution?
"Better" in what sense? If the intent of the atexit
handler is to cleanup something, and it's already cleaned up, is there anything else to do?
Description
I'm using the package within a download function like so:
While, the package works as expected when running the program, when running unit test with pytest the test output is followed by the error message pasted below.
System settings
pip freeze
output:Error
Expected behaviour
I wouldn't expect the package to have any impact on these tests that isn't present when running the program.
Steps to recreate
People to notify