class_docstr: Test st.write.
  
  Unit tests for https://docs.streamlit.io/library/api-reference/write-magic/st.write
  
  Because we're going to test st.markdown, st.pyplot, st.altair_chart
  later on, we don't have to test it in st.write In st.write, all we're
  trying to check is that the right st.* method gets called
class_docstr_tok: ["Test","st.write",".","Unit","tests","for","https",":","\/\/docs.streamlit.io\/library\/api-reference\/write-magic\/st.write","Because","we","'re","going","to","test","st.markdown",",","st.pyplot",",","st.altair_chart","later","on",",","we","do","n't","have","to","test","it","in","st.write","In","st.write",",","all","we're","trying","to","check","is","that","the","right","st.","*","method","gets","called"]
docstr: Test st.write from a specific element.
code: def test_empty(self):
      """Test st.write from a specific element."""
      placeholder = st.empty()
  
      with patch(
          "streamlit.delta_generator.DeltaGenerator.markdown"
      ) as p:
          placeholder.write("One argument is okay...")
  
          p.assert_called_once()
  
      with self.assertRaises(StreamlitAPIException):
          # Also override dg._is_top_level for this test.
          with patch.object(
              st.delta_generator.DeltaGenerator,
              "_is_top_level",
              new_callable=PropertyMock,
          ) as top_level:
              top_level.return_value = False
  
              placeholder.write(
                  "But", "multiple", "args", "should", "fail"
              )
  
imports: import dataclasses
  import time
  import unittest
  from collections import namedtuple
  from unittest.mock import Mock, PropertyMock, call, patch
  import numpy
  import pandas
  import pytest
  import streamlit
  from streamlit import type_util
  from streamlit.elements import write
  from streamlit.error_util import handle_uncaught_app_exception
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state import QueryParamsProxy, SessionStateProxy
label_desc: Use image node_id 27 for calling the StreamlitWriteTest obj's underlying member method code with example usage: obj.test_empty() without return types