Return random-generated FloatToDecimalCase instances.
(float_ty, max_precision)
| 2359 | |
| 2360 | |
| 2361 | def random_float_to_decimal_cast_cases(float_ty, max_precision): |
| 2362 | """ |
| 2363 | Return random-generated FloatToDecimalCase instances. |
| 2364 | """ |
| 2365 | r = random.Random(42) |
| 2366 | for precision in range(1, max_precision, 6): |
| 2367 | for scale in range(0, precision, 4): |
| 2368 | for i in range(20): |
| 2369 | unscaled = r.randrange(0, 10**precision) |
| 2370 | float_val = scaled_float(unscaled, scale) |
| 2371 | assert float_val * 10**scale < 10**precision |
| 2372 | yield FloatToDecimalCase(precision, scale, float_val) |
| 2373 | |
| 2374 | |
| 2375 | def check_cast_float_to_decimal(float_ty, float_val, decimal_ty, decimal_ctx, |
nothing calls this directly
no test coverage detected