class_docstr: Base class for testing expected errors for pattern mining.
class_docstr_tok: ["Base","class","for","testing","expected","errors","for","pattern","mining","."]
code: def test_raise_error_if_input_is_not_binary(self):
      def test_with_dataframe(df):
          assert_raises(
              ValueError,
              "The allowed values for a DataFrame are True, "
              "False, 0, 1. Found value 2",
              self.fpalgo,
              df,
          )
  
      df2 = pd.DataFrame(self.one_ary, columns=self.cols).copy()
      df2.iloc[3, 3] = 2
      test_with_dataframe(df2)
  
      sdf = df2.astype(pd.SparseDtype("int", fill_value=0))
      test_with_dataframe(sdf)
  
imports: import sys
  from contextlib import contextmanager
  from io import StringIO
  import numpy
  import pandas
  from numpy.testing import assert_array_equal
  from packaging.version import Version
  from pandas import __version__
  from scipy.sparse import csr_matrix
  from mlxtend.preprocessing import TransactionEncoder
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 3 for calling the FPTestErrors obj's underlying member method code with example usage: obj.test_raise_error_if_input_is_not_binary() without return types