Best Python code snippet using pandera_python
test_deprecations.py
Source: test_deprecations.py
...455 np.integer, np.unsignedinteger, np.signedinteger,456 # character is a deprecated S1 special case:457 np.character,458 ]459 def test_dtype_coercion(self):460 for scalar_type in self.deprecated_types:461 self.assert_deprecated(np.dtype, args=(scalar_type,))462 def test_array_construction(self):463 for scalar_type in self.deprecated_types:464 self.assert_deprecated(np.array, args=([], scalar_type,))465 def test_not_deprecated(self):466 # All specific types are not deprecated:467 for group in np.sctypes.values():468 for scalar_type in group:469 self.assert_not_deprecated(np.dtype, args=(scalar_type,))470 for scalar_type in [type, dict, list, tuple]:471 # Typical python types are coerced to object currently:472 self.assert_not_deprecated(np.dtype, args=(scalar_type,))473class BuiltInRoundComplexDType(_DeprecationTestCase):...
test_pyfftw_dask_interface.py
Source: test_pyfftw_dask_interface.py
...359 s += i * 2360 i *= i361 self.validate(dtype_tuple[1],362 test_shape, dtype, s, kwargs)363 def test_dtype_coercion(self):364 # Make sure we input a dtype that needs to be coerced365 if functions[self.func] == 'r2c':366 dtype_tuple = self.io_dtypes['complex']367 else:368 dtype_tuple = self.io_dtypes['r2c']369 for dtype in dtype_tuple[0]:370 for test_shape, s, kwargs in self.test_data:371 s = None372 self.validate(dtype_tuple[1],373 test_shape, dtype, s, kwargs)374 def test_input_maintained(self):375 '''Test to make sure the input is maintained by default.376 '''377 dtype_tuple = self.io_dtypes[functions[self.func]]...
test_schemas_on_modin.py
Source: test_schemas_on_modin.py
...240 schema(mpd.DataFrame({"another_field": [1, 2, 3]}))241@pytest.mark.parametrize("from_dtype", [str])242@pytest.mark.parametrize("to_dtype", [float, int, str, bool])243@hypothesis.given(st.data())244def test_dtype_coercion(from_dtype, to_dtype, data):245 """Test the datatype coercion provides informative errors."""246 from_schema = pa.DataFrameSchema({"field": pa.Column(from_dtype)})247 to_schema = pa.DataFrameSchema({"field": pa.Column(to_dtype, coerce=True)})248 pd_sample = data.draw(from_schema.strategy(size=3))249 sample = mpd.DataFrame(pd_sample)250 if from_dtype is to_dtype:251 assert isinstance(to_schema(sample), mpd.DataFrame)252 return253 if from_dtype is str and to_dtype in {int, float}:254 try:255 result = to_schema(sample)256 assert result["field"].dtype == to_dtype257 except pa.errors.SchemaError as err:258 for x in err.failure_cases.failure_case:...
Check out the latest blogs from LambdaTest on this topic:
I routinely come across test strategy documents when working with customers. They are lengthy—100 pages or more—and packed with monotonous text that is routinely reused from one project to another. Yawn once more— the test halt and resume circumstances, the defect management procedure, entrance and exit criteria, unnecessary generic risks, and in fact, one often-used model replicates the requirements of textbook testing, from stress to systems integration.
When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.
Pair testing can help you complete your testing tasks faster and with higher quality. But who can do pair testing, and when should it be done? And what form of pair testing is best for your circumstance? Check out this blog for more information on how to conduct pair testing to optimize its benefits.
People love to watch, read and interact with quality content — especially video content. Whether it is sports, news, TV shows, or videos captured on smartphones, people crave digital content. The emergence of OTT platforms has already shaped the way people consume content. Viewers can now enjoy their favorite shows whenever they want rather than at pre-set times. Thus, the OTT platform’s concept of viewing anything, anytime, anywhere has hit the right chord.
Have you ever visited a website that only has plain text and images? Most probably, no. It’s because such websites do not exist now. But there was a time when websites only had plain text and images with almost no styling. For the longest time, websites did not focus on user experience. For instance, this is how eBay’s homepage looked in 1999.
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!!