def assert_bool_op_calc(opname, alternative, frame, has_skipna=True):
f = getattr(frame, opname)<EOL>if has_skipna:<EOL><INDENT>def skipna_wrapper(x):<EOL><INDENT>nona = x.dropna().values<EOL>return alternative(nona)<EOL><DEDENT>def wrapper(x):<EOL><INDENT>return alternative(x.values)<EOL><DEDENT>result0 = f(axis=<NUM_LIT:0>, skipna=False)<EOL>result1 = f(axis=<NUM_LIT:1>, skipna=False)<EOL>tm.assert_series_equal(result0, frame.apply(wrapper))<EOL>tm.assert_series_equal(result1, frame.apply(wrapper, axis=<NUM_LIT:1>),<EOL>check_dtype=False)  <EOL><DEDENT>else:<EOL><INDENT>skipna_wrapper = alternative<EOL>wrapper = alternative<EOL><DEDENT>result0 = f(axis=<NUM_LIT:0>)<EOL>result1 = f(axis=<NUM_LIT:1>)<EOL>tm.assert_series_equal(result0, frame.apply(skipna_wrapper))<EOL>tm.assert_series_equal(result1, frame.apply(skipna_wrapper, axis=<NUM_LIT:1>),<EOL>check_dtype=False)<EOL>with pytest.raises(ValueError, match='<STR_LIT>'):<EOL><INDENT>f(axis=<NUM_LIT:2>)<EOL><DEDENT>if has_skipna:<EOL><INDENT>all_na = frame * np.NaN<EOL>r0 = getattr(all_na, opname)(axis=<NUM_LIT:0>)<EOL>r1 = getattr(all_na, opname)(axis=<NUM_LIT:1>)<EOL>if opname == '<STR_LIT>':<EOL><INDENT>assert not r0.any()<EOL>assert not r1.any()<EOL><DEDENT>else:<EOL><INDENT>assert r0.all()<EOL>assert r1.all()<EOL><DEDENT><DEDENT>
Check that bool operator opname works as advertised on frame

Parameters
----------
opname : string
    Name of the operator to test on frame
alternative : function
    Function that opname is tested against; i.e. "frame.opname()" should
    equal "alternative(frame)".
frame : DataFrame
    The object that the tests are executed on
has_skipna : bool, default True
    Whether the method "opname" has the kwarg "skip_na"