Best Python code snippet using pandera_python
test_decorators.py
Source:test_decorators.py
...134 assert isinstance(df, pd.DataFrame)135 df = test_func4("foo", df)136 assert x == "foo"137 assert isinstance(df, pd.DataFrame)138def test_check_function_decorator_errors() -> None:139 """Test that the check_input and check_output decorators error properly."""140 # case 1: checks that the input and output decorators error when different141 # types are passed in and out142 @check_input(DataFrameSchema({"column1": Column(Int)}))143 @check_output(DataFrameSchema({"column2": Column(Float)}))144 def test_func(df):145 return df146 with pytest.raises(147 errors.SchemaError,148 match=r"^error in check_input decorator of function",149 ):150 test_func(pd.DataFrame({"column2": ["a", "b", "c"]}))151 with pytest.raises(152 errors.SchemaError,...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!