code: def test_period_add_invalid(self):
      # GH#4731
      per1 = Period(freq="D", year=2008, month=1, day=1)
      per2 = Period(freq="D", year=2008, month=1, day=2)
  
      msg = "|".join(
          [
              r"unsupported operand type\(s\)",
              "can only concatenate str",
              "must be str, not Period",
          ]
      )
      with pytest.raises(TypeError, match=msg):
          per1 + "str"
      with pytest.raises(TypeError, match=msg):
          "str" + per1
      with pytest.raises(TypeError, match=msg):
          per1 + per2
  
imports: from datetime import timedelta
  import numpy
  import pytest
  from pandas._libs.tslibs.period import IncompatibleFrequency
  from pandas import NaT, Period, Timedelta, Timestamp, offsets
label_desc: Use image node_id 3 for calling the TestPeriodArithmetic obj's underlying member method code with example usage: obj.test_period_add_invalid() without return types