Просмотр исходного кода

ref: exhaust streaming response to prevent ResourceWarning (#38915)

I couldn't actually reproduce this one locally due to chromedriver
shenanigans -- but in theory this is the same as the other ones I fixed
like #35429
anthony sottile 2 лет назад
Родитель
Сommit
c36b3146e6
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      tests/chartcuterie/test_chart_renderer.py

+ 1 - 1
tests/chartcuterie/test_chart_renderer.py

@@ -20,6 +20,6 @@ class TestChartRenderer(AcceptanceTestCase):
 
 
             # Ensure our chart images actually look like pngs
             # Ensure our chart images actually look like pngs
             assert resp.status_code == 200
             assert resp.status_code == 200
-            assert next(resp.streaming_content)[:4] == b"\x89PNG"
+            assert b"".join(resp.streaming_content)[:4] == b"\x89PNG"
 
 
         self.browser.snapshot("chart renderer debug view via chartcuterie")
         self.browser.snapshot("chart renderer debug view via chartcuterie")