1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643
|
=========
Changelog
=========
This is a record of all past Hypothesis releases and what went into them,
in reverse chronological order. All previous releases should still be available
:pypi:`on PyPI <hypothesis>`.
Hypothesis 6.x
==============
.. only:: has_release_file
--------------------
Current pull request
--------------------
.. include:: ../RELEASE.rst
.. _v6.138.0:
--------------------
6.138.0 - 2025-08-13
--------------------
On Python 3.14, |memoryview| is newly generic. This release adds the ability for |st.from_type| to resolve generic |memoryview| types on 3.14, like ``st.from_type(memoryview[CustomBufferClass])`` . ``CustomBufferClass`` must implement ``__buffer__``, as expected by |memoryview|.
.. _v6.137.3:
--------------------
6.137.3 - 2025-08-11
--------------------
This patch makes the stringification of lambdas, and as
a result certain automatic filter rewriting operations,
more robust. This fixes :issue:`4498`, where a lambda
was mistakenly identified as the identity operator due
to :func:`inspect.getsource` only returning the first
line of the lambda definition.
As a result, the ``repr`` of strategies filtered or
mapped by lambda functions may change slightly.
.. _v6.137.2:
--------------------
6.137.2 - 2025-08-11
--------------------
Add support for Python 3.14, `which is currently in release candidate 1 <https://devguide.python.org/versions/>`_.
.. _v6.137.1:
--------------------
6.137.1 - 2025-08-05
--------------------
Fixes a bug with solver-based :ref:`alternative backends <alternative-backends>` (like `crosshair <https://github.com/pschanely/CrossHair>`_) where symbolic values passed to |event| would not be realized to concrete values at the end of the test case.
.. _v6.137.0:
--------------------
6.137.0 - 2025-08-05
--------------------
Add the |add_observability_callback|, |remove_observability_callback|, |with_observability_callback|, and |observability_enabled| methods to the :ref:`observability <observability>` interface. The previous |TESTCASE_CALLBACKS| is deprecated.
This release also adds better threading support to observability callbacks. An observability callback will now only be called for observations generated by the same thread.
.. _v6.136.9:
--------------------
6.136.9 - 2025-08-04
--------------------
Fix a threading race condition in |st.one_of| initialization.
.. _v6.136.8:
--------------------
6.136.8 - 2025-08-04
--------------------
Improve the error messages and documentation for |HealthCheck|. Among others, the messaging is now more clear that health checks are proactive warnings, not correctness errors.
.. _v6.136.7:
--------------------
6.136.7 - 2025-08-01
--------------------
Improve detection of sys.monitoring to avoid errors on GraalPy.
.. _v6.136.6:
--------------------
6.136.6 - 2025-07-28
--------------------
When a test is executed concurrently from multiple threads, |HealthCheck.too_slow| is now disabled, since the Python runtime may decide to switch away from a thread for arbitrarily long and Hypothesis cannot track execution time per-thread.
.. _v6.136.5:
--------------------
6.136.5 - 2025-07-28
--------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.136.4:
--------------------
6.136.4 - 2025-07-25
--------------------
|HealthCheck.differing_executors| is no longer raised if a test is executed by different executors from different threads. |HealthCheck.differing_executors| will still be raised if a test is executed by different executors in the same thread.
.. _v6.136.3:
--------------------
6.136.3 - 2025-07-23
--------------------
When a test is executed concurrently from multiple threads, |DeadlineExceeded| is now disabled, since the Python runtime may decide to switch away from a thread for longer than |settings.deadline|, and Hypothesis cannot track execution time per-thread. See :issue:`4478`.
.. _v6.136.2:
--------------------
6.136.2 - 2025-07-21
--------------------
|@precondition| now errors if used without |@rule| or |@invariant|. Doing so has no effect and is indicative of a user error (:issue:`4413`).
.. _v6.136.1:
--------------------
6.136.1 - 2025-07-20
--------------------
Fix |PrimitiveProvider.on_observation| being called with observations it wasn't responsible for generating if the test failed.
.. _v6.136.0:
--------------------
6.136.0 - 2025-07-19
--------------------
When a failure found by an :ref:`alternative backend <alternative-backends>` does not reproduce under the Hypothesis backend, we now raise |FlakyBackendFailure| instead of an internal ``FlakyReplay`` exception.
.. _v6.135.33:
---------------------
6.135.33 - 2025-07-18
---------------------
Speculative fix for a thread-safety issue in calculating strategy labels.
.. _v6.135.32:
---------------------
6.135.32 - 2025-07-15
---------------------
Improve the thread-safety of strategy validation.
Before this release, Hypothesis did not require that ``super().__init__()`` be called in ``SearchStrategy`` subclasses. Subclassing ``SearchStrategy`` is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call ``super().__init__()`` after this release.
.. _v6.135.31:
---------------------
6.135.31 - 2025-07-15
---------------------
Fix a remaining thread-safety issue with the deprecation warning for use of the global random instance (see :ref:`v6.135.24 <v6.135.24>`).
.. _v6.135.30:
---------------------
6.135.30 - 2025-07-14
---------------------
Fix a remaining thread-safety issue with the recursion limit warning Hypothesis issues when an outside caller sets ``sys.setrecursionlimit`` (see :ref:`v6.135.23 <v6.135.23>`).
.. _v6.135.29:
---------------------
6.135.29 - 2025-07-12
---------------------
Optimize performance of |st.sampled_from| and internal selection of :ref:`stateful testing <stateful>` rules.
.. _v6.135.28:
---------------------
6.135.28 - 2025-07-12
---------------------
Optimize the memory and speed of an internal datastructure for compactly storing integers.
.. _v6.135.27:
---------------------
6.135.27 - 2025-07-12
---------------------
Improve thread-safety for stateful |@initialize| rules.
.. _v6.135.26:
---------------------
6.135.26 - 2025-07-05
---------------------
Fix a "dictionary changed size during iteration" error that could occur under with |register_random| under multiple threads.
.. _v6.135.25:
---------------------
6.135.25 - 2025-07-05
---------------------
Improve thread safety of our :mod:`sys.monitoring` usage (by the |Phase.shrink| and |Phase.explain| phases), as well as the internal computation of strategy labels.
.. _v6.135.24:
---------------------
6.135.24 - 2025-07-03
---------------------
Makes the deprecation warning for using the global random instance thread-safe, as part of our work towards thread safety (:issue:`4451`).
.. _v6.135.23:
---------------------
6.135.23 - 2025-07-02
---------------------
In order to de-flake ``RecursionError`` failures, Hypothesis sets a deterministic limit on ``sys.setrecursionlimit``. This patch makes the setting of this limit aware of uses by Hypothesis from multiple threads, so it does not produce spurious warnings in multithreaded environments.
.. _v6.135.22:
---------------------
6.135.22 - 2025-07-02
---------------------
Improves the thread safety of caching strategy definitions, as well as usage of strategy transformations like |.map| and |.filter|.
.. _v6.135.21:
---------------------
6.135.21 - 2025-07-02
---------------------
Fix the thread safety of |@rule| definitions in |RuleBasedStateMachine|.
.. _v6.135.20:
---------------------
6.135.20 - 2025-06-30
---------------------
Fixes ``reproduction_decorator`` being missing under :ref:`hypothesis-specific metadata <observability-hypothesis-metadata>` in many :ref:`observability <observability>` observations, when it should have been present.
.. _v6.135.19:
---------------------
6.135.19 - 2025-06-30
---------------------
Improve threading compatibility of an internal helper for managing deterministic rng seeding.
.. _v6.135.18:
---------------------
6.135.18 - 2025-06-30
---------------------
Remove an internal assertion which could trigger if (1) a lambda was present in the source code of a test, (2) and the source code file was edited on disk between the start of the python process and when Hypothesis runs the property.
.. _v6.135.17:
---------------------
6.135.17 - 2025-06-30
---------------------
Refactor some internals related to the shrinker for better compatibility with free-threading (:issue:`4451`).
.. _v6.135.16:
---------------------
6.135.16 - 2025-06-26
---------------------
Fixes an error when the ``_pytest`` module is present in ``sys.modules``, but *not* the ``_pytest.outcomes`` or ``_pytest.fixtures`` modules. This can happen with code that imports just ``_pytest``, without importing ``pytest``.
.. _v6.135.15:
---------------------
6.135.15 - 2025-06-25
---------------------
Temporarily disable the warning when |st.shared| strategies with the same ``key`` draw from different base strategies, due to false alarms. Once we fix the false alarms in a future release, the warning will be re-enabled.
.. _v6.135.14:
---------------------
6.135.14 - 2025-06-20
---------------------
Speed up usages of |st.sampled_from| by deferring evaluation of its repr, and truncating its repr for large collections (over 512 elements). This is especially noticeable when using |st.sampled_from| with large collections. The repr of |st.sampled_from| strategies involving sequence classes with custom reprs may change as a result of this release.
.. _v6.135.13:
---------------------
6.135.13 - 2025-06-20
---------------------
Fixes a substantial performance regression in stateful tests from computing string representations, present since :ref:`version 6.131.20 <v6.131.20>`.
.. _v6.135.12:
---------------------
6.135.12 - 2025-06-19
---------------------
Fix a rare race condition in internal cache eviction logic.
.. _v6.135.11:
---------------------
6.135.11 - 2025-06-17
---------------------
This patch fixes an error when importing :ref:`our django extra <hypothesis-django>` (via ``hypothesis.extra.django``) if ``django.contrib.auth`` was not in ``INSTALLED_APPS`` (:issue:`3716`).
Thanks to Chris Wesseling for this fix!
.. _v6.135.10:
---------------------
6.135.10 - 2025-06-15
---------------------
Fix a rare race condition in |ExampleDatabase.fetch|, where we might have read from a non-existent directory.
.. _v6.135.9:
--------------------
6.135.9 - 2025-06-13
--------------------
Refactor some internal code related to patches to make it easier to test.
.. _v6.135.8:
--------------------
6.135.8 - 2025-06-13
--------------------
Add type hints to internal code for patching.
.. _v6.135.7:
--------------------
6.135.7 - 2025-06-12
--------------------
Fixes a race condition in |ExampleDatabase.add_listener| for |DirectoryBasedExampleDatabase| after version :ref:`6.135.1 <v6.135.1>` where the listener might have tried to read a file that doesn't exist.
.. _v6.135.6:
--------------------
6.135.6 - 2025-06-11
--------------------
This patch corrects the f-string formatting of a few array-related error messages.
.. _v6.135.5:
--------------------
6.135.5 - 2025-06-10
--------------------
Improve the error message when applying |@given| to a :pypi:`pytest` fixture with pytest 8.4.0.
.. _v6.135.4:
--------------------
6.135.4 - 2025-06-09
--------------------
Further improve the performance of the constants-collection feature introduced in :ref:`version 6.131.1 <v6.131.1>`, by ignoring large files and files with many constants.
.. _v6.135.3:
--------------------
6.135.3 - 2025-06-08
--------------------
This release adds the experimental and unstable |OBSERVABILITY_CHOICES| option for :ref:`observability <observability>`. If set, the choice sequence is included in ``metadata.choice_nodes``, and choice sequence spans are included in ``metadata.choice_spans``.
These are relatively low-level implementation detail of Hypothesis, and are exposed in observability for users building tools or research on top of Hypothesis. See |PrimitiveProvider| for more details about the choice sequence and choice spans.
We are actively working towards a better interface for this. Feel free to use |OBSERVABILITY_CHOICES| to experiment, but don't rely on it yet!
.. _v6.135.2:
--------------------
6.135.2 - 2025-06-08
--------------------
This patch restores compatibility when using `the legacy Python 3.9 LL(1)
parser <https://docs.python.org/3/whatsnew/3.9.html#new-parser>`__ yet
again, because the fix in :ref:`version 6.131.33 <v6.131.33>` was too
brittle.
Thanks to Marco Ricci for this fix!
.. _v6.135.1:
--------------------
6.135.1 - 2025-06-05
--------------------
|DirectoryBasedExampleDatabase| now removes empty directories after |ExampleDatabase.delete| is called.
.. _v6.135.0:
--------------------
6.135.0 - 2025-06-03
--------------------
This release adds :func:`~hypothesis.internal.conjecture.provider_conformance.run_conformance_test`, for use in testing implementations of :ref:`alternative backends <alternative-backends>`.
.. _v6.134.0:
--------------------
6.134.0 - 2025-06-03
--------------------
This patch adds :class:`hypothesis.extra.django.SimpleTestCase` (:issue:`4117`)
Thanks to Chris Wesseling for this contribution!
.. _v6.133.2:
--------------------
6.133.2 - 2025-06-03
--------------------
Internal changes to support `hypofuzz <https://hypofuzz.com>`__.
.. _v6.133.1:
--------------------
6.133.1 - 2025-06-03
--------------------
The ``to_json`` hook used internally when writing :ref:`observability <observability>` reports is now supported on nested dataclasses (in addition to outermost dataclasses).
.. _v6.133.0:
--------------------
6.133.0 - 2025-06-02
--------------------
Warn when :func:`~hypothesis.strategies.shared` strategies with the same ``key``
draw from different base strategies. This could lead to subtle failures or
lower-than-expected example coverage.
.. _v6.132.0:
--------------------
6.132.0 - 2025-05-31
--------------------
Add |PrimitiveProvider.on_observation| to the internal :ref:`alternative backends <alternative-backends-internals>` interface.
.. _v6.131.33:
---------------------
6.131.33 - 2025-05-31
---------------------
This patch restores compatibility when using `the legacy Python 3.9 LL(1)
parser <https://docs.python.org/3/whatsnew/3.9.html#new-parser>`__, which
was accidentally broken since :ref:`version 6.130.13 <v6.130.13>`.
Thanks to Marco Ricci for this fix!
.. _v6.131.32:
---------------------
6.131.32 - 2025-05-30
---------------------
:ref:`fuzz_one_input <fuzz_one_input>` now writes :ref:`observability reports <observability>` if observability is enabled, bringing it in line with the behavior of other standard ways to invoke a Hypothesis test.
.. _v6.131.31:
---------------------
6.131.31 - 2025-05-30
---------------------
Improve documentation of |@example|.
.. _v6.131.30:
---------------------
6.131.30 - 2025-05-27
---------------------
This patch resolves a Pandas FutureWarning (:issue:`4400`) caused by indexing with an integer key.
.. _v6.131.29:
---------------------
6.131.29 - 2025-05-27
---------------------
The observations passed to |TESTCASE_CALLBACKS| are now dataclasses, rather than dictionaries. The content written to ``.hypothesis/observed`` under ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY`` remains the same.
.. _v6.131.28:
---------------------
6.131.28 - 2025-05-25
---------------------
Add documentation to some internal APIs.
.. _v6.131.27:
---------------------
6.131.27 - 2025-05-24
---------------------
Add ``PrimitiveProvider.replay_choices`` to the :ref:`alternative backends <alternative-backends>` interface, to support warm-starting e.g. :pypi:`hypothesis-crosshair` from :pypi:`hypofuzz`.
.. _v6.131.26:
---------------------
6.131.26 - 2025-05-24
---------------------
Improve |ExampleDatabase| documentation.
.. _v6.131.25:
---------------------
6.131.25 - 2025-05-23
---------------------
Add some internal type hints.
.. _v6.131.24:
---------------------
6.131.24 - 2025-05-23
---------------------
Improve |@settings| documentation.
.. _v6.131.23:
---------------------
6.131.23 - 2025-05-23
---------------------
This patch adds ``GITLAB_CI`` to the environment variables checked when enabling the default CI |settings| profile.
Thanks to Genevieve Mendoza for this contribution!
.. _v6.131.22:
---------------------
6.131.22 - 2025-05-22
---------------------
Include |note| and |Phase.explain| output in the "representation" field of :ref:`observability reports <observability>` for failing examples, to more closely match the output produced by Hypothesis.
.. _v6.131.21:
---------------------
6.131.21 - 2025-05-21
---------------------
|BackgroundWriteDatabase| instances now defer creating and starting a thread until first use.
.. _v6.131.20:
---------------------
6.131.20 - 2025-05-20
---------------------
Improve the string representation of |st.characters| in some cases.
.. _v6.131.19:
---------------------
6.131.19 - 2025-05-19
---------------------
Cap the length of bytestrings collected as part of the constants-collection feature introduced in :ref:`version 6.131.1 <v6.131.1>`, as long bytestrings are unlikely to be useful.
.. _v6.131.18:
---------------------
6.131.18 - 2025-05-17
---------------------
All |ExampleDatabase| implementations in Hypothesis now implement ``__eq__``.
.. _v6.131.17:
---------------------
6.131.17 - 2025-05-14
---------------------
Further improve the performance of the new features introduced in :ref:`version 6.131.1 <v6.131.1>`, by improving unions of large sets.
.. _v6.131.16:
---------------------
6.131.16 - 2025-05-13
---------------------
Improve performance of an internal method to count possible choices.
.. _v6.131.15:
---------------------
6.131.15 - 2025-05-07
---------------------
Improves output when assigning values to multiple target bundles
in a stateful rule (:issue:`4361`).
.. _v6.131.14:
---------------------
6.131.14 - 2025-05-07
---------------------
Internal optimization to reduce redundant choice sequence spans.
.. _v6.131.13:
---------------------
6.131.13 - 2025-05-07
---------------------
Add a ``for_failure: bool = False`` parameter to ``provider.realize`` in :ref:`alternative backends <alternative-backends>`, so that symbolic-based backends can increase their timeouts when realizing failures, which are more important than regular examples.
.. _v6.131.12:
---------------------
6.131.12 - 2025-05-06
---------------------
Improve type hints for the single-argument form of |st.one_of|. ``st.one_of(strategies)`` now matches the type of ``st.one_of(*strategies)``. For instance, ``st.one_of([st.integers(), st.none()])`` now has the correct type of ``SearchStrategy[int | None]`` instead of ``SearchStrategy[Any]``.
.. _v6.131.11:
---------------------
6.131.11 - 2025-05-06
---------------------
Fix incorrectly reporting :ref:`alternative backends <alternative-backends>` as unsound in some cases.
.. _v6.131.10:
---------------------
6.131.10 - 2025-05-06
---------------------
Remove more false-positive locations from |Phase.explain| output, and add a new ``metadata.reproduction_decorator`` field in :ref:`observability reports <observability>` for failing examples.
.. _v6.131.9:
--------------------
6.131.9 - 2025-04-25
--------------------
Fix a ``BytesWarning`` after :ref:`version 6.131.1 <v6.131.1>` if the source code used the same value in both a normal and binary string.
.. _v6.131.8:
--------------------
6.131.8 - 2025-04-23
--------------------
|DirectoryBasedExampleDatabase| will now fall back to (potentially non-atomic)
copies rather than renames, if the temporary directory used for atomic
write-and-rename is on a different filesystem to the configured database
location (:issue:`4335`).
.. _v6.131.7:
--------------------
6.131.7 - 2025-04-22
--------------------
Further improve the performance of the new features introduced in :ref:`version 6.131.1 <v6.131.1>`.
.. _v6.131.6:
--------------------
6.131.6 - 2025-04-19
--------------------
This patch makes the new features introduced in :ref:`version 6.131.1 <v6.131.1>` much
faster, and fixes an internal ``RecursionError`` when working with deeply-nested code.
.. _v6.131.5:
--------------------
6.131.5 - 2025-04-18
--------------------
Fix a rare case where database entries were kept after they were no longer needed when using |Phase.target|.
.. _v6.131.4:
--------------------
6.131.4 - 2025-04-18
--------------------
Internal refactoring of the |@settings| object, with no user-visible change.
.. _v6.131.3:
--------------------
6.131.3 - 2025-04-18
--------------------
Fixes a rare internal error where new code from :ref:`version 6.131.1 <v6.131.1>`
could fail if :py:data:`sys.modules` is simultaneously modified, e.g. as a side
effect of imports executed from another thread. Our :ref:`thread-safety-policy`
does not promise that this is supported, but we're happy to take reasonable
fixes.
Thanks to Tony Li for reporting and fixing this issue.
.. _v6.131.2:
--------------------
6.131.2 - 2025-04-17
--------------------
The pub-sub change listening interface of the :ref:`Hypothesis database <database>` now correctly fires events for |DirectoryBasedExampleDatabase| if the directory was created after the listener was added.
Also disables on emscripten the constants-extraction feature introduced in :ref:`v6.131.1`, where it caused substantial slowdown.
.. _v6.131.1:
--------------------
6.131.1 - 2025-04-17
--------------------
Hypothesis now looks for constant values in the source code of your program, and sometimes uses them while generating examples. This lets Hypothesis generate interesting inputs that are specific to your program.
.. _v6.131.0:
--------------------
6.131.0 - 2025-04-10
--------------------
Add |is_hypothesis_test|, for third-party libraries which want to determine whether a test has been defined with Hypothesis.
.. _v6.130.13:
---------------------
6.130.13 - 2025-04-09
---------------------
Refactor some internals.
.. _v6.130.12:
---------------------
6.130.12 - 2025-04-09
---------------------
Lays some groundwork for future work on collecting interesting literals from the code being tested, for increased bug-finding power (:issue:`3127`). There is no user-visible change (yet!)
.. _v6.130.11:
---------------------
6.130.11 - 2025-04-08
---------------------
Fix the caching behavior of |st.sampled_from|, which in rare cases led to failing an internal assertion (:issue:`4339`).
.. _v6.130.10:
---------------------
6.130.10 - 2025-04-07
---------------------
This patch deprecates creating a database using the abstract ``ExampleDatabase()`` class. Use one of the following instead:
* Replace ``ExampleDatabase(":memory:")`` with |InMemoryExampleDatabase|.
* Replace ``ExampleDatabase("/path/to/dir")`` with |DirectoryBasedExampleDatabase|.
* Replace ``ExampleDatabase()`` with either |InMemoryExampleDatabase| or |DirectoryBasedExampleDatabase|, depending on your needs. Previously, Hypothesis interpreted ``ExampleDatabase()`` as a |DirectoryBasedExampleDatabase| in the default ``.hypothesis`` directory, with a fallback to |InMemoryExampleDatabase| if that location was not available.
.. _v6.130.9:
--------------------
6.130.9 - 2025-04-06
--------------------
When reporting the always-failing, never-passing lines from the |Phase.explain| phase, we now sort the reported lines so that local code shows up first, then third-party library code, then standard library code.
.. _v6.130.8:
--------------------
6.130.8 - 2025-04-02
--------------------
Improves the documentation of |settings.Verbosity| objects.
.. _v6.130.7:
--------------------
6.130.7 - 2025-04-02
--------------------
Rename internal variables for clarity.
.. _v6.130.6:
--------------------
6.130.6 - 2025-03-31
--------------------
Update the documentation link in |HealthCheck| error messages to their new location in the documentation.
.. _v6.130.5:
--------------------
6.130.5 - 2025-03-28
--------------------
Improve our internal type hints.
.. _v6.130.4:
--------------------
6.130.4 - 2025-03-25
--------------------
Improve an additional interaction between the :pypi:`hypothesis-crosshair`
:ref:`backend <alternative-backends>` and :ref:`our observability tools <observability>`.
.. _v6.130.3:
--------------------
6.130.3 - 2025-03-24
--------------------
This patch improves the interaction between the :pypi:`hypothesis-crosshair`
:ref:`backend <alternative-backends>` and :ref:`our observability tools <observability>`.
.. _v6.130.2:
--------------------
6.130.2 - 2025-03-22
--------------------
Fix an issue with realizing symbolic values provided by :ref:`alternative backends <alternative-backends>` when Hypothesis encounters an internal error in its engine.
.. _v6.130.1:
--------------------
6.130.1 - 2025-03-22
--------------------
Improve the documentation for some strategies, including |st.composite| and |st.data|.
.. _v6.130.0:
--------------------
6.130.0 - 2025-03-21
--------------------
Nesting :func:`@given <hypothesis.given>` inside of :func:`@given <hypothesis.given>` is now a |HealthCheck| failure. Nesting :func:`@given <hypothesis.given>` results in quadratic generation and shrinking behavior, and can usually be more cleanly expressed by replacing the inner function with a :func:`~hypothesis.strategies.data` parameter on the outer given. For more details, see :obj:`~hypothesis.HealthCheck.nested_given`. (:issue:`4167`)
.. _v6.129.5:
--------------------
6.129.5 - 2025-03-21
--------------------
Fixes an internal error when certain :ref:`alternative backends <alternative-backends>` find a failure on their very first generated example.
.. _v6.129.4:
--------------------
6.129.4 - 2025-03-18
--------------------
:func:`~hypothesis.strategies.nothing` is now typed as ``SearchStrategy[Never]``, because no value can ever be drawn from it. This may help type checkers statically determine that some code is not reachable.
.. _v6.129.3:
--------------------
6.129.3 - 2025-03-16
--------------------
This patch improves the string representation of :func:`~hypothesis.strategies.fixed_dictionaries`.
.. _v6.129.2:
--------------------
6.129.2 - 2025-03-14
--------------------
Improve how the shrinker checks for unnecessary work, leading to 10% less time spent shrinking on average, with no reduction in quality.
.. _v6.129.1:
--------------------
6.129.1 - 2025-03-13
--------------------
:func:`~hypothesis.strategies.randoms` no longer produces ``1.0``, matching
the exclusive upper bound of :obj:`random.Random.random` (:issue:`4297`).
.. _v6.129.0:
--------------------
6.129.0 - 2025-03-11
--------------------
This release adds a ``"hypothesis-urandom"`` :ref:`backend <alternative-backends>`, which draws randomness from ``/dev/urandom`` instead of Python's PRNG. This is useful for users of `Antithesis <https://antithesis.com/>`_ who also have Hypothesis tests, allowing Antithesis mutation of ``/dev/urandom`` to drive Hypothesis generation. We expect it to be strictly slower than the default backend for everyone else.
It can be enabled with ``@settings(backend="hypothesis-urandom")``.
.. _v6.128.3:
--------------------
6.128.3 - 2025-03-11
--------------------
For strategies which draw make recursive draws, including :func:`~hypothesis.strategies.recursive` and :func:`~hypothesis.strategies.deferred`, we now generate examples with duplicated subtrees more often. This tends to uncover interesting behavior in tests.
For instance, we might now generate a tree like this more often (though the details depend on the strategy):
.. code-block:: none
┌─────┐
┌──────┤ a ├──────┐
│ └─────┘ │
┌──┴──┐ ┌──┴──┐
│ b │ │ a │
└──┬──┘ └──┬──┘
┌────┴────┐ ┌────┴────┐
┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐
│ c │ │ d │ │ b │ │ ... │
└─────┘ └─────┘ └──┬──┘ └─────┘
┌────┴────┐
┌──┴──┐ ┌──┴──┐
│ c │ │ d │
└─────┘ └─────┘
.. _v6.128.2:
--------------------
6.128.2 - 2025-03-10
--------------------
Improves input validation for several strategies in our :ref:`pandas extra
<hypothesis-pandas>`, so that they raise a helpful ``InvalidArgument`` rather
than ``OverflowError``.
Discovered by our recent :ref:`string generation upgrade <v6.128.0>`.
.. _v6.128.1:
--------------------
6.128.1 - 2025-03-09
--------------------
Rename a few internal classes for clarity.
.. _v6.128.0:
--------------------
6.128.0 - 2025-03-09
--------------------
:func:`~hypothesis.strategies.text` now occasionally generates from a preselected list of strings which are likely to find bugs. These include ligatures, right-to-left and top-to-bottom text, emojis, emoji modifiers, strings like ``"Infinity"``, ``"None"``, and ``"FALSE"``, and other interesting things. This is especially useful when testing the full unicode range, where the search space is too large for uniform sampling to be very effective.
Of course, examples generated this way shrink just like they normally would. It was always possible for Hypothesis to generate these strings; it is just more likely after this change. From the outside, it is as if Hypothesis generated the example completely randomly.
Many thanks to the `Big List of Naughty Strings <https://github.com/minimaxir/big-list-of-naughty-strings>`_, `Text Rendering Hates You <https://faultlore.com/blah/text-hates-you/>`_, and `Text Editing Hates You Too <https://lord.io/text-editing-hates-you-too/>`_ for forming the basis of this list.
.. _v6.127.9:
--------------------
6.127.9 - 2025-03-06
--------------------
We now provide a better string representation for :func:`~hypothesis.strategies.one_of` strategies, by flattening consecutive ``|`` combinations. For instance:
.. code-block:: pycon
>>> st.integers() | st.text() | st.booleans()
# previously: one_of(one_of(integers(), text()), booleans())
one_of(integers(), text(), booleans())
Explicit calls to :func:`~hypothesis.strategies.one_of` remain unflattened, in order to make tracking down complicated :func:`~hypothesis.strategies.one_of` constructions easier:
.. code-block:: pycon
>>> st.one_of(st.integers(), st.one_of(st.text(), st.booleans()))
one_of(integers(), one_of(text(), booleans()))
We print ``one_of`` in reprs (rather than ``integers() | text() | ...``) for consistency with reprs containing ``.filter`` or ``.map`` calls, which uses the full ``one_of`` to avoid ambiguity.
.. _v6.127.8:
--------------------
6.127.8 - 2025-03-06
--------------------
This patch improves shrinking behavior for values from :func:`~hypothesis.strategies.text` and :func:`~hypothesis.strategies.binary` which contain duplicate elements, like ``"zzzabc"``. It also improves shrinking for bugs which require the same character to be drawn from two different :func:`~hypothesis.strategies.text` strategies to trigger.
.. _v6.127.7:
--------------------
6.127.7 - 2025-03-05
--------------------
Fix a type-hinting regression from :ref:`version 6.125.1 <v6.125.1>`, where we would no longer guarantee the type of the argument to ``.filter`` predicates (:issue:`4269`).
.. code-block:: python
# x was previously Unknown, but is now correctly guaranteed to be int
st.integers().filter(lambda x: x > 0)
.. _v6.127.6:
--------------------
6.127.6 - 2025-03-04
--------------------
This patch tweaks the performance of |Phase.target|, avoiding aborting some test cases when it would be better to finish generating them.
.. _v6.127.5:
--------------------
6.127.5 - 2025-03-03
--------------------
This patch fixes a bug where :func:`~hypothesis.strategies.from_type` would error on certain types involving :class:`~python:typing.Protocol` (:issue:`4194`).
.. _v6.127.4:
--------------------
6.127.4 - 2025-03-02
--------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.127.3:
--------------------
6.127.3 - 2025-02-28
--------------------
Improve shrinking of non-standard NaN float values (:issue:`4277`).
.. _v6.127.2:
--------------------
6.127.2 - 2025-02-24
--------------------
Adjust type hints for the pub-sub database implementation in :ref:`version 6.126.0 <v6.126.0>`, and remove a remnant debug print in its implementation.
.. _v6.127.1:
--------------------
6.127.1 - 2025-02-23
--------------------
Improve the clarity of printing counterexamples in :ref:`stateful testing <stateful>`, by avoiding confusing :class:`~hypothesis.stateful.Bundle` references with equivalent values drawn from a regular strategy.
For example, we now print:
.. code-block:: python
a_0 = state.add_to_bundle(a=0)
state.unrelated(value=0)
instead of
.. code-block:: python
a_0 = state.add_to_bundle(a=0)
state.unrelated(value=a_0)
if the ``unrelated`` rule draws from a regular strategy such as :func:`~hypothesis.strategies.integers` instead of the ``a`` bundle.
.. _v6.127.0:
--------------------
6.127.0 - 2025-02-23
--------------------
This releases adds support for type aliases created with the :py:keyword:`type` statement (new in python 3.12) to :func:`~hypothesis.strategies.from_type` and :func:`~hypothesis.strategies.register_type_strategy`.
.. _v6.126.0:
--------------------
6.126.0 - 2025-02-18
--------------------
The :ref:`Hypothesis database <database>` now supports a pub-sub interface to efficiently listen for changes in the database, via ``.add_listener`` and ``.remove_listener``. While all databases that ship with Hypothesis support this interface, implementing it is not required for custom database subclasses. Hypothesis will warn when trying to listen on a database without support.
This feature is currently only used downstream in `hypofuzz <https://github.com/zac-hd/hypofuzz>`_.
.. _v6.125.3:
--------------------
6.125.3 - 2025-02-11
--------------------
Improves sharing of some internal cache behavior.
.. _v6.125.2:
--------------------
6.125.2 - 2025-02-06
--------------------
Optimize performance (improves speed by ~5%) and clarify the wording in an error message.
.. _v6.125.1:
--------------------
6.125.1 - 2025-02-03
--------------------
Fixes a bug since around :ref:`version 6.124.4 <v6.124.4>` where we might have generated ``-0.0`` for ``st.floats(min_value=0.0)``, which is unsound.
.. _v6.125.0:
--------------------
6.125.0 - 2025-02-03
--------------------
Add 2024.12 to the list of recognized Array API versions in
``hypothesis.extra.array_api``.
.. _v6.124.9:
--------------------
6.124.9 - 2025-02-01
--------------------
Registration of experimental :ref:`alternative-backends` is now done via ``hypothesis.internal.conjecture.providers.AVAILABLE_PROVIDERS`` instead of ``hypothesis.internal.conjecture.data.AVAILABLE_PROVIDERS``.
.. _v6.124.8:
--------------------
6.124.8 - 2025-02-01
--------------------
Refactor some internals for better type hinting.
.. _v6.124.7:
--------------------
6.124.7 - 2025-01-25
--------------------
Internal renamings.
.. _v6.124.6:
--------------------
6.124.6 - 2025-01-25
--------------------
More work on internal type hints.
.. _v6.124.5:
--------------------
6.124.5 - 2025-01-25
--------------------
Internal refactoring to make some stateful internals easier to access.
.. _v6.124.4:
--------------------
6.124.4 - 2025-01-25
--------------------
Refactoring of our internal input generation. This shouldn't lead to any changes in the distribution of test inputs. If you notice any, please open an issue!
.. _v6.124.3:
--------------------
6.124.3 - 2025-01-24
--------------------
Some Hypothesis internals now use the number of choices as a yardstick of input size, rather than the entropy consumed by those choices. We don't expect this to cause significant behavioral changes.
.. _v6.124.2:
--------------------
6.124.2 - 2025-01-21
--------------------
Improves our internal caching logic for test cases.
.. _v6.124.1:
--------------------
6.124.1 - 2025-01-18
--------------------
:ref:`fuzz_one_input <fuzz_one_input>` is now implemented using an :ref:`alternative backend <alternative-backends>`. This brings the interpretation of the fuzzer-provided bytestring closer to the fuzzer mutations, allowing the mutations to work more reliably. We hope to use this backend functionality to improve fuzzing integration (e.g. `atheris issue #20 <https://github.com/google/atheris/issues/20>`__) in the future!
.. _v6.124.0:
--------------------
6.124.0 - 2025-01-16
--------------------
The :ref:`Hypothesis example database <database>` now uses a new internal format to store examples. This new format is not compatible with the previous format, so stored entries will not carry over.
The database is best thought of as a cache that may be invalidated at times. Instead of relying on it for correctness, we recommend using :obj:`@example <hypothesis.example>` to specify explicit examples. When using databases across environments (such as connecting a :class:`~hypothesis.database.GitHubArtifactDatabase` database in CI to your local environment), we recommend using the same version of Hypothesis for each where possible, for maximum reproducibility.
.. _v6.123.17:
---------------------
6.123.17 - 2025-01-13
---------------------
This patch improves certain corner cases for reporting of flaky errors
(:issue:`4183` and :issue:`4228`).
.. _v6.123.16:
---------------------
6.123.16 - 2025-01-13
---------------------
Improves an edge case in one of our integer and float shrinking passes.
.. _v6.123.15:
---------------------
6.123.15 - 2025-01-11
---------------------
Improves one of our shrinking passes for integers which require a constant relative difference to trigger the bug.
.. _v6.123.14:
---------------------
6.123.14 - 2025-01-11
---------------------
Avoid realizing symbolic values from :ref:`alternative-backends` when |Verbosity| is ``verbose`` or higher.
.. _v6.123.13:
---------------------
6.123.13 - 2025-01-09
---------------------
More internal code refactoring.
.. _v6.123.12:
---------------------
6.123.12 - 2025-01-09
---------------------
:class:`~hypothesis.database.DirectoryBasedExampleDatabase` now creates files representing database entries atomically, avoiding a very brief intermediary state where a file could be created but not yet written to.
.. _v6.123.11:
---------------------
6.123.11 - 2025-01-09
---------------------
Internal code refactoring.
.. _v6.123.10:
---------------------
6.123.10 - 2025-01-09
---------------------
Fixes a bug caused by :ref:`alternative backends <alternative-backends>` raising ``hypothesis.errors.BackendCannotProceed`` in certain cases.
.. _v6.123.9:
--------------------
6.123.9 - 2025-01-08
--------------------
Add internal type hints to our pretty printer.
.. _v6.123.8:
--------------------
6.123.8 - 2025-01-08
--------------------
The shrinker contains a pass aimed at integers which are required to sum to a value. This patch extends that pass to floats as well.
.. _v6.123.7:
--------------------
6.123.7 - 2025-01-07
--------------------
Internal type hint additions and refactorings.
.. _v6.123.6:
--------------------
6.123.6 - 2025-01-07
--------------------
:func:`@reproduce_failure() <hypothesis.reproduce_failure>` now uses a newer internal interface to represent failures. As a reminder, this representation is not intended to be stable across versions or with respect to changes in the test.
.. _v6.123.5:
--------------------
6.123.5 - 2025-01-07
--------------------
Internal code refactoring for the typed choice sequence (:issue:`3921`). May have some neutral effect on shrinking.
.. _v6.123.4:
--------------------
6.123.4 - 2025-01-06
--------------------
This patch improves shrinking involving long strings or byte sequences whose value is not relevant to the failure.
.. _v6.123.3:
--------------------
6.123.3 - 2025-01-06
--------------------
This release further improves shrinking of strategies using :func:`~hypothesis.strategies.one_of`,
allowing the shrinker to more reliably move between branches of the strategy.
.. _v6.123.2:
--------------------
6.123.2 - 2024-12-27
--------------------
The shrinker now uses the typed choice sequence (:issue:`3921`) when ordering failing examples. As a result, Hypothesis may now report a different minimal failing example for some tests. We expect most cases to remain unchanged.
.. _v6.123.1:
--------------------
6.123.1 - 2024-12-24
--------------------
Our pytest plugin now emits a warning if you set Pytest's ``norecursedirs``
config option in such a way that the ``.hypothesis`` directory would be
searched for tests. This reliably indicates that you've made a mistake
which slows down test collection, usually assuming that your configuration
extends the set of ignored patterns when it actually replaces them.
(:issue:`4200`)
.. _v6.123.0:
--------------------
6.123.0 - 2024-12-23
--------------------
:func:`~hypothesis.strategies.from_type` can now handle constructors with
required positional-only arguments if they have type annotations. Previously,
we only passed arguments by keyword.
.. _v6.122.7:
--------------------
6.122.7 - 2024-12-23
--------------------
This patch lays some groundwork for migrating our internal representation to the typed choice sequence (:issue:`3921`)
.. _v6.122.6:
--------------------
6.122.6 - 2024-12-21
--------------------
This patch cleans up some internal code around clamping floats.
.. _v6.122.5:
--------------------
6.122.5 - 2024-12-20
--------------------
This release improves shrinking in some cases, especially for strategies using :func:`~hypothesis.strategies.one_of`.
This will typically improve shrinking speed and may in some cases improve the end result.
.. _v6.122.4:
--------------------
6.122.4 - 2024-12-19
--------------------
This patch improves generation performance for the provisional :func:`~hypothesis.provisional.domains` strategy, including its derivative strategies :func:`~hypothesis.provisional.urls` and :func:`~hypothesis.strategies.emails`.
.. _v6.122.3:
--------------------
6.122.3 - 2024-12-08
--------------------
This patch improves our error and warning messages.
- Add a warning for ``st.text("ascii")`` - you probably meant ``st.text(st.characters(codec="ascii"))``. Similarly for ``"utf-8"``.
- Recommend remedies in the error message of ``Unsatisfiable``.
- When ``@given`` errors because it was given an extra keyword argument, and the keyword matches a setting name like ``max_examples``, recommend ``@settings(max_examples=...)`` instead.
.. _v6.122.2:
--------------------
6.122.2 - 2024-12-08
--------------------
This patch updates some outdated external links in our documentation.
.. _v6.122.1:
--------------------
6.122.1 - 2024-12-01
--------------------
Fix :func:`~hypothesis.strategies.from_type`
on :class:`collections.abc.Callable` returning ``None``.
.. _v6.122.0:
--------------------
6.122.0 - 2024-11-29
--------------------
This release adds ``.span_start()`` and ``.span_end()`` methods
to our internal ``PrimitiveProvider`` interface, for use by
:ref:`alternative-backends`.
.. _v6.121.2:
--------------------
6.121.2 - 2024-11-29
--------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.121.1:
--------------------
6.121.1 - 2024-11-29
--------------------
This release brings back the old representation of :class:`hypothesis.stateful.Bundle`, reverting most changes of `PR #4124 <https://github.com/HypothesisWorks/hypothesis/pull/4124>`_.
.. _v6.121.0:
--------------------
6.121.0 - 2024-11-28
--------------------
This release adds :class:`~hypothesis.database.BackgroundWriteDatabase`, a new database backend which defers writes on the wrapped database to a background thread. This allows for low-overhead writes in performance-critical environments like :ref:`fuzz_one_input <fuzz_one_input>`.
.. _v6.120.0:
--------------------
6.120.0 - 2024-11-27
--------------------
* This release changes our input distribution for low ``max_examples``. Previously, we capped the size of inputs when generating at least the first 10 inputs, with the reasoning that early inputs to a property should be small. However, this meant properties with ``max_examples=10`` would consistent entirely of small inputs. This patch removes the hard lower bound so that inputs to these properties are more representative of the input space.
* When a user requests an interactive input via ``strategy.example``, we generate and cache a batch of 100 inputs, returning the first one. This can be expensive for large strategies or when only a few examples are needed. This release improves the speed of ``strategy.example`` by lowering the batch size to 10.
.. _v6.119.4:
--------------------
6.119.4 - 2024-11-22
--------------------
This patch fixes a bug since :ref:`v6.99.13` where only interactively-generated values (via ``data.draw``) would be reported in the ``arguments`` field of our :ref:`observability output <observability>`. Now, all values are reported.
.. _v6.119.3:
--------------------
6.119.3 - 2024-11-17
--------------------
Hypothesis collects coverage information during the |Phase.shrink| and |Phase.explain| phases in order to show a more informative error message. On 3.12+, this uses :mod:`sys.monitoring`. This patch improves the performance of coverage collection on 3.12+ by disabling events we don't need.
.. _v6.119.2:
--------------------
6.119.2 - 2024-11-17
--------------------
This patch refactors some internals to prepare for future work using our IR (:issue:`3921`).
.. _v6.119.1:
--------------------
6.119.1 - 2024-11-15
--------------------
This patch migrates some more internals (around generating novel inputs) to the IR layer (:issue:`3921`).
.. _v6.119.0:
--------------------
6.119.0 - 2024-11-15
--------------------
This release improves Hypothesis' handling of ExceptionGroup - it's now able to detect marker detections if they're inside a group and attempts to resolve them. Note that this handling is still a work in progress and might not handle edge cases optimally. Please open issues if you encounter any problems or unexpected behavior with it.
.. _v6.118.9:
--------------------
6.118.9 - 2024-11-15
--------------------
Internal refactorings in preparation for upcoming changes.
.. _v6.118.8:
--------------------
6.118.8 - 2024-11-12
--------------------
Internal renamings.
.. _v6.118.7:
--------------------
6.118.7 - 2024-11-10
--------------------
This patch removes some ``# type: ignore`` comments following a :pypi:`mypy` update.
.. _v6.118.6:
--------------------
6.118.6 - 2024-11-10
--------------------
When Hypothesis replays examples from its test database that it knows were previously fully shrunk it will no longer try to shrink them again.
This should significantly speed up development workflows for slow tests, as the shrinking could contribute a significant delay when rerunning the tests.
In some rare cases this may cause minor reductions in example quality. This was considered an acceptable tradeoff for the improved test runtime.
.. _v6.118.5:
--------------------
6.118.5 - 2024-11-10
--------------------
This patch avoids computing some string representations we won't need,
giving a small speedup (part of :issue:`4139`).
.. _v6.118.4:
--------------------
6.118.4 - 2024-11-10
--------------------
This patch migrates the optimisation algorithm for :ref:`targeted property-based testing <targeted>` to our IR layer (:issue:`3921`). This should result in moderately different (and hopefully improved) exploration behavior in tests which use :func:`hypothesis.target`.
.. _v6.118.3:
--------------------
6.118.3 - 2024-11-10
--------------------
This patch adds more type hints to internal Hypothesis code.
.. _v6.118.2:
--------------------
6.118.2 - 2024-11-09
--------------------
This patch migrates the |Phase.explain| phase to our IR layer (:issue:`3921`). This should improve both its speed and precision.
.. _v6.118.1:
--------------------
6.118.1 - 2024-11-09
--------------------
This patch updates some internals around how we determine an input is too large to finish generating.
.. _v6.118.0:
--------------------
6.118.0 - 2024-11-08
--------------------
The :func:`~hypothesis.provisional.urls` strategy no longer generates
URLs where the port number is 0.
This change is motivated by the idea that the generated URLs should, at least in
theory, be possible to fetch. The port number 0 is special; if a server binds to
port 0, the kernel will allocate an unused, and non-zero, port instead. That
means that it's not possible for a server to actually be listening on port 0.
This motivation is briefly described in the documentation for
:func:`~hypothesis.provisional.urls`.
Thanks to @gmacon for fixing :issue:`4157`!
.. _v6.117.0:
--------------------
6.117.0 - 2024-11-07
--------------------
This changes the behaviour of settings profiles so that if you reregister the currently loaded profile it will automatically reload it. Previously you would have had to load it again.
In particular this means that if you register a "ci" profile, it will automatically be used when Hypothesis detects you are running on CI.
.. _v6.116.0:
--------------------
6.116.0 - 2024-11-01
--------------------
Hypothesis now detects if it is running on a CI server and provides better default settings for running on CI in this case.
.. _v6.115.6:
--------------------
6.115.6 - 2024-10-30
--------------------
This patch changes the priority order of pretty printing logic so that a user
provided pretty printing method will always be used in preference to e.g.
printing it like a dataclass.
.. _v6.115.5:
--------------------
6.115.5 - 2024-10-23
--------------------
This patch restores diversity to the outputs of
:func:`from_type(type) <hypothesis.strategies.from_type>` (:issue:`4144`).
.. _v6.115.4:
--------------------
6.115.4 - 2024-10-23
--------------------
This release improves pretty printing of nested classes to include the outer class name in their printed representation.
.. _v6.115.3:
--------------------
6.115.3 - 2024-10-16
--------------------
This patch fixes a regression from :ref:`version 6.115.2 <v6.115.2>` where generating values from :func:`~hypothesis.strategies.integers` with certain values for ``min_value`` and ``max_value`` would error.
.. _v6.115.2:
--------------------
6.115.2 - 2024-10-14
--------------------
This release improves integer shrinking by folding the endpoint upweighting for :func:`~hypothesis.strategies.integers` into the ``weights`` parameter of our IR (:issue:`3921`).
If you maintain an alternative backend as part of our (for now explicitly unstable) :ref:`alternative-backends`, this release changes the type of the ``weights`` parameter to ``draw_integer`` and may be a breaking change for you.
.. _v6.115.1:
--------------------
6.115.1 - 2024-10-14
--------------------
This patch improves the performance of :func:`~hypothesis.strategies.from_type` with
`pydantic.types.condate <https://docs.pydantic.dev/latest/api/types/#pydantic.types.condate>`__
(:issue:`4000`).
.. _v6.115.0:
--------------------
6.115.0 - 2024-10-12
--------------------
This improves the formatting of dataclasses and attrs classes when printing
falsifying examples.
.. _v6.114.1:
--------------------
6.114.1 - 2024-10-10
--------------------
This patch upgrades remaining type annotations to Python 3.9 syntax.
.. _v6.114.0:
--------------------
6.114.0 - 2024-10-09
--------------------
This release drops support for Python 3.8, `which reached end of life on
2024-10-07 <https://devguide.python.org/versions/>`__.
.. _v6.113.0:
--------------------
6.113.0 - 2024-10-09
--------------------
This release adds ``hypothesis.errors.BackendCannotProceed``, an unstable API
for use by :ref:`alternative-backends`.
.. _v6.112.5:
--------------------
6.112.5 - 2024-10-08
--------------------
This release fixes a regression where :class:`hypothesis.stateful.Bundle` did not work properly with |.flatmap| functionality (:issue:`4128`).
.. _v6.112.4:
--------------------
6.112.4 - 2024-10-06
--------------------
This patch tweaks the paths in ``@example(...)`` patches, so that
both ``git apply`` and ``patch`` will work by default.
.. _v6.112.3:
--------------------
6.112.3 - 2024-10-05
--------------------
This release refactors internals of :class:`hypothesis.stateful.Bundle` to have a more consistent representation internally.
.. _v6.112.2:
--------------------
6.112.2 - 2024-09-29
--------------------
This patch fixes an internal error when the ``__context__``
attribute of a raised exception leads to a cycle (:issue:`4115`).
.. _v6.112.1:
--------------------
6.112.1 - 2024-09-13
--------------------
This patch removes a now-incorrect internal assertion about numpy's typing after recent numpy changes (currently only in numpy's nightly release).
.. _v6.112.0:
--------------------
6.112.0 - 2024-09-05
--------------------
This release adds support for variable-width bytes in our IR layer (:issue:`3921`), which should mean improved performance anywhere you use :func:`~hypothesis.strategies.binary`. If you maintain an alternative backend as part of our (for now explicitly unstable) :ref:`alternative-backends`, this release changes the ``draw_*`` interface and may be a breaking change for you.
.. _v6.111.2:
--------------------
6.111.2 - 2024-08-24
--------------------
This patch contains some internal code cleanup. There is no user-visible change.
.. _v6.111.1:
--------------------
6.111.1 - 2024-08-15
--------------------
This patch improves shrinking in cases involving 'slips' from one strategy to another. Highly composite strategies are the most likely to benefit from this change.
This patch also reduces the range of :class:`python:datetime.datetime` generated by :func:`~hypothesis.extra.django.from_model` in order to avoid https://code.djangoproject.com/ticket/35683.
.. _v6.111.0:
--------------------
6.111.0 - 2024-08-11
--------------------
:ref:`alternative-backends` can now implement ``.observe_test_case()``
and ``observe_information_message()`` methods, to record backend-specific
metadata and messages in our :ref:`observability output <observability>`
(:issue:`3845` and `hypothesis-crosshair#22
<https://github.com/pschanely/hypothesis-crosshair/issues/22>`__).
.. _v6.110.2:
--------------------
6.110.2 - 2024-08-11
--------------------
Support ``__default__`` field of :obj:`~python:typing.TypeVar`
and support the same from :pypi:`typing-extensions`
in :func:`~hypothesis.strategies.from_type`.
.. _v6.110.1:
--------------------
6.110.1 - 2024-08-08
--------------------
Add better error message for :obj:`~python:typing.TypeIs` types
in :func:`~hypothesis.strategies.from_type`.
.. _v6.110.0:
--------------------
6.110.0 - 2024-08-07
--------------------
Support :obj:`~python:typing.LiteralString`
in :func:`~hypothesis.strategies.from_type`.
.. _v6.109.1:
--------------------
6.109.1 - 2024-08-07
--------------------
This patch makes progress towards adding type hints to our internal conjecture engine (:issue:`3074`).
.. _v6.109.0:
--------------------
6.109.0 - 2024-08-07
--------------------
This release allows using :obj:`~python:typing.Annotated`
and :obj:`!ReadOnly` types
for :class:`~python:typing.TypedDict` value types
with :func:`~hypothesis.strategies.from_type`.
.. _v6.108.10:
---------------------
6.108.10 - 2024-08-06
---------------------
This patch fixes compatibility with :pypi:`attrs==24.1.0 <attrs>`
on the nightly build of CPython, 3.14.0 pre-alpha (:issue:`4067`).
.. _v6.108.9:
--------------------
6.108.9 - 2024-08-05
--------------------
This patch removes an assertion which was in fact possible in rare circumstances involving a small number of very large draws.
.. _v6.108.8:
--------------------
6.108.8 - 2024-08-04
--------------------
This patch improves our example generation performance by adjusting our internal cache implementation.
.. _v6.108.7:
--------------------
6.108.7 - 2024-08-04
--------------------
This patch improves our pretty-printer for unusual numbers.
- Signalling NaNs are now represented by using the :mod:`struct` module
to show the exact value by converting from a hexadecimal integer
- CPython `limits integer-to-string conversions
<https://docs.python.org/3/library/stdtypes.html#integer-string-conversion-length-limitation>`__
to mitigate DDOS attacks. We now use hexadecimal for very large
integers, and include underscore separators for integers with ten
or more digits.
.. _v6.108.6:
--------------------
6.108.6 - 2024-08-04
--------------------
This patch improves generation speed in some cases by avoiding pretty-printing overhead for non-failing examples.
.. _v6.108.5:
--------------------
6.108.5 - 2024-07-28
--------------------
This patch fixes a rare internal error when using :func:`~hypothesis.strategies.integers` with a high number of examples and certain ``{min, max}_value`` parameters (:pull:`4059`).
.. _v6.108.4:
--------------------
6.108.4 - 2024-07-22
--------------------
This patch addresses the issue of hypothesis potentially accessing
mocked ``time.perf_counter`` during test execution (:issue:`4051`).
.. _v6.108.3:
--------------------
6.108.3 - 2024-07-22
--------------------
Minor internal-only cleanups to some error-handling and reporting code.
.. _v6.108.2:
--------------------
6.108.2 - 2024-07-15
--------------------
This patch disables :func:`hypothesis.target` on alternative
backends where it would not work.
.. _v6.108.1:
--------------------
6.108.1 - 2024-07-14
--------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.108.0:
--------------------
6.108.0 - 2024-07-13
--------------------
This patch changes most ``Flaky`` errors to use an :class:`ExceptionGroup`, which
makes the representation of these errors easier to understand.
.. _v6.107.0:
--------------------
6.107.0 - 2024-07-13
--------------------
The ``alphabet=`` argument to :func:`~hypothesis.strategies.from_regex`
now accepts unions of :func:`~hypothesis.strategies.characters` and
:func:`~hypothesis.strategies.sampled_from` strategies, in addition to
accepting each individually.
This patch also fixes a bug where ``text(...).filter(re.compile(...).match)``
could generate non-matching instances if the regex pattern contained ``|``
(:issue:`4008`).
.. _v6.106.1:
--------------------
6.106.1 - 2024-07-12
--------------------
This patch improves our pretty-printer (:issue:`4037`).
It also fixes the codemod for ``HealthCheck.all()`` from
:ref:`version 6.72 <v6.72.0>`, which was instead trying to
fix ``Healthcheck.all()`` - note the lower-case ``c``!
Since our tests had the same typo, it all looked good...
until :issue:`4030`.
.. _v6.106.0:
--------------------
6.106.0 - 2024-07-12
--------------------
This release improves support for unions of :pypi:`numpy` dtypes such as
``np.float64 | np.complex128`` in :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.extra.numpy.arrays` (:issue:`4041`).
.. _v6.105.2:
--------------------
6.105.2 - 2024-07-12
--------------------
This patch improves the reporting of certain flaky errors.
.. _v6.105.1:
--------------------
6.105.1 - 2024-07-07
--------------------
This patch iterates on our experimental support for alternative backends (:ref:`alternative-backends`). See :pull:`4029` for details.
.. _v6.105.0:
--------------------
6.105.0 - 2024-07-04
--------------------
This release improves support for Django 5.0, and drops support for end-of-life Django versions (< 4.2).
Thanks to Joshua Munn for this contribution.
.. _v6.104.4:
--------------------
6.104.4 - 2024-07-04
--------------------
Clean up internal cache implementation.
.. _v6.104.3:
--------------------
6.104.3 - 2024-07-04
--------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.104.2:
--------------------
6.104.2 - 2024-06-29
--------------------
This patch fixes an issue when realizing symbolics with our experimental :obj:`~hypothesis.settings.backend` setting.
.. _v6.104.1:
--------------------
6.104.1 - 2024-06-25
--------------------
Improves internal test coverage.
.. _v6.104.0:
--------------------
6.104.0 - 2024-06-24
--------------------
This release adds strategies for Django's ``ModelChoiceField`` and
``ModelMultipleChoiceField`` (:issue:`4010`).
Thanks to Joshua Munn for this contribution.
.. _v6.103.5:
--------------------
6.103.5 - 2024-06-24
--------------------
Fixes and reinstates full coverage of internal tests, which was accidentally
disabled in :pull:`3935` (:issue:`4003`).
.. _v6.103.4:
--------------------
6.103.4 - 2024-06-24
--------------------
This release prevents a race condition inside internal cache implementation.
.. _v6.103.3:
--------------------
6.103.3 - 2024-06-24
--------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.103.2:
--------------------
6.103.2 - 2024-06-14
--------------------
This patch improves our deduplication tracking across all strategies (:pull:`4007`). Hypothesis is now less likely to generate the same input twice.
.. _v6.103.1:
--------------------
6.103.1 - 2024-06-05
--------------------
Account for time spent in garbage collection during tests, to avoid
flaky ``DeadlineExceeded`` errors as seen in :issue:`3975`.
Also fixes overcounting of stateful run times,
a minor observability bug dating to :ref:`version 6.98.9 <v6.98.9>`
(:pull:`3890`).
.. _v6.103.0:
--------------------
6.103.0 - 2024-05-29
--------------------
This release migrates the shrinker to our new internal representation, called the IR layer (:pull:`3962`). This improves the shrinker's performance in the majority of cases. For example, on the Hypothesis test suite, shrinking is a median of 1.38x faster.
It is possible this release regresses performance while shrinking certain strategies. If you encounter strategies which reliably shrink more slowly than they used to (or shrink slowly at all), please open an issue!
You can read more about the IR layer at :issue:`3921`.
.. _v6.102.6:
--------------------
6.102.6 - 2024-05-23
--------------------
This patch fixes one of our shrinking passes getting into a rare ``O(n)`` case instead of ``O(log(n))``.
.. _v6.102.5:
--------------------
6.102.5 - 2024-05-22
--------------------
This patch fixes some introspection errors new in Python 3.11.9 and
3.13.0b1, for the Ghostwriter and :func:`~hypothesis.strategies.from_type`.
.. _v6.102.4:
--------------------
6.102.4 - 2024-05-15
--------------------
Internal developer documentation, no user-visible changes.
.. _v6.102.3:
--------------------
6.102.3 - 2024-05-15
--------------------
This patch improves our shrinking of unique collections, such as :func:`~hypothesis.strategies.dictionaries`,
:func:`~hypothesis.strategies.sets`, and :func:`~hypothesis.strategies.lists` with ``unique=True``.
.. _v6.102.2:
--------------------
6.102.2 - 2024-05-15
--------------------
This patch fixes a rare internal error when generating very large elements from strategies (:issue:`3874`).
.. _v6.102.1:
--------------------
6.102.1 - 2024-05-13
--------------------
This patch fixes an overly strict internal type assertion.
.. _v6.102.0:
--------------------
6.102.0 - 2024-05-13
--------------------
This release improves our support for the :pypi:`annotated-types` iterable
``GroupedMetadata`` protocol. In order to treat the elements "as if they
had been unpacked", if one such element is a :class:`~hypothesis.strategies.SearchStrategy`
we now resolve to that strategy. Previously, we treated this as an unknown
filter predicate.
We expect this to be useful for libraries implementing custom metadata -
instead of requiring downstream integration, they can implement the protocol
and yield a lazily-created strategy. Doing so only if Hypothesis is in
:obj:`sys.modules` gives powerful integration with no runtime overhead
or extra dependencies.
.. _v6.101.0:
--------------------
6.101.0 - 2024-05-13
--------------------
The :func:`~hypothesis.extra.django.from_model` function currently
tries to create a strategy for :obj:`~django:django.db.models.AutoField`
fields if they don't have :attr:`~django:django.db.models.Field.auto_created`
set to `True`. The docs say it's supposed to skip all
:obj:`~django:django.db.models.AutoField` fields, so this patch updates
the code to do what the docs say (:issue:`3978`).
.. _v6.100.8:
--------------------
6.100.8 - 2024-05-13
--------------------
This patch adds some internal type annotations (:issue:`3074`).
Thanks to Andrew Sansom for his contribution!
.. _v6.100.7:
--------------------
6.100.7 - 2024-05-12
--------------------
This patch fixes a rare internal error when using :func:`~hypothesis.strategies.integers` with a high ``max_examples`` setting (:issue:`3974`).
.. _v6.100.6:
--------------------
6.100.6 - 2024-05-10
--------------------
This patch improves our internal caching logic. We don't expect it to result in any performance improvements (yet!).
.. _v6.100.5:
--------------------
6.100.5 - 2024-05-06
--------------------
This patch turns off a check in :func:`~hypothesis.register_random` for possibly
unreferenced RNG instances on the free-threaded build of CPython 3.13 because
this check has a much higher false positive rate in the free-threaded build
(:issue:`3965`).
Thanks to Nathan Goldbaum for this patch.
.. _v6.100.4:
--------------------
6.100.4 - 2024-05-05
--------------------
This patch turns off a warning for functions decorated with
:func:`typing.overload` and then :func:`~hypothesis.strategies.composite`,
although only in that order (:issue:`3970`).
.. _v6.100.3:
--------------------
6.100.3 - 2024-05-04
--------------------
This patch fixes a significant slowdown when using the :func:`~hypothesis.stateful.precondition` decorator in some cases, due to expensive repr formatting internally (:issue:`3963`).
.. _v6.100.2:
--------------------
6.100.2 - 2024-04-28
--------------------
Explicitly cast :obj:`numpy.finfo.smallest_normal` to builtin `float` in
preparation for the :pypi:`numpy==2.0 <numpy>` release (:issue:`3950`)
.. _v6.100.1:
--------------------
6.100.1 - 2024-04-08
--------------------
This patch improve a rare error message for flaky tests (:issue:`3940`).
.. _v6.100.0:
--------------------
6.100.0 - 2024-03-31
--------------------
The :func:`~hypothesis.extra.numpy.from_dtype` function no longer generates
``NaT`` ("not-a-time") values for the ``datetime64`` or ``timedelta64`` dtypes
if passed ``allow_nan=False`` (:issue:`3943`).
.. _v6.99.13:
--------------------
6.99.13 - 2024-03-24
--------------------
This patch includes the :obj:`~hypothesis.settings.backend` setting in the
``how_generated`` field of our :ref:`observability output <observability>`.
.. _v6.99.12:
--------------------
6.99.12 - 2024-03-23
--------------------
If you were running Python 3.13 (currently in alpha) with :pypi:`pytest-xdist`
and then attempted to pretty-print a ``lambda`` functions which was created
using the :func:`eval` builtin, it would have raised an AssertionError.
Now you'll get ``"lambda ...: <unknown>"``, as expected.
.. _v6.99.11:
--------------------
6.99.11 - 2024-03-20
--------------------
This release improves an internal invariant.
.. _v6.99.10:
--------------------
6.99.10 - 2024-03-20
--------------------
This patch fixes Hypothesis sometimes raising a ``Flaky`` error when generating collections of unique floats containing ``nan``. See :issue:`3926` for more details.
.. _v6.99.9:
-------------------
6.99.9 - 2024-03-19
-------------------
This patch continues our work on refactoring the shrinker (:issue:`3921`).
.. _v6.99.8:
-------------------
6.99.8 - 2024-03-18
-------------------
This patch continues our work on refactoring shrinker internals (:issue:`3921`).
.. _v6.99.7:
-------------------
6.99.7 - 2024-03-18
-------------------
This release resolves :py:exc:`PermissionError` that come from
creating databases on inaccessible paths.
.. _v6.99.6:
-------------------
6.99.6 - 2024-03-14
-------------------
This patch starts work on refactoring our shrinker internals. There is no user-visible change.
.. _v6.99.5:
-------------------
6.99.5 - 2024-03-12
-------------------
This patch fixes a longstanding performance problem in stateful testing (:issue:`3618`),
where state machines which generated a substantial amount of input for each step would
hit the maximum amount of entropy and then fail with an ``Unsatisfiable`` error.
We now stop taking additional steps when we're approaching the entropy limit,
which neatly resolves the problem without touching unaffected tests.
.. _v6.99.4:
-------------------
6.99.4 - 2024-03-11
-------------------
Fix regression caused by using :pep:`696` default in TypeVar with Python 3.13.0a3.
.. _v6.99.3:
-------------------
6.99.3 - 2024-03-11
-------------------
This patch further improves the type annotations in :mod:`hypothesis.extra.numpy`.
.. _v6.99.2:
-------------------
6.99.2 - 2024-03-10
-------------------
Simplify the type annotation of :func:`~hypothesis.extra.pandas.column` and
:func:`~hypothesis.extra.pandas.columns` by using :pep:`696` to avoid overloading.
.. _v6.99.1:
-------------------
6.99.1 - 2024-03-10
-------------------
This patch implements type annotations for :func:`~hypothesis.extra.pandas.column`.
.. _v6.99.0:
-------------------
6.99.0 - 2024-03-09
-------------------
This release adds the **experimental and unstable** :obj:`~hypothesis.settings.backend`
setting. See :ref:`alternative-backends` for details.
.. _v6.98.18:
--------------------
6.98.18 - 2024-03-09
--------------------
This patch fixes :issue:`3900`, a performance regression for
:func:`~hypothesis.extra.numpy.arrays` due to the interaction of
:ref:`v6.98.12` and :ref:`v6.97.1`.
.. _v6.98.17:
--------------------
6.98.17 - 2024-03-04
--------------------
This patch improves the type annotations in :mod:`hypothesis.extra.numpy`,
which makes inferred types more precise for both :pypi:`mypy` and
:pypi:`pyright`, and fixes some strict-mode errors on the latter.
Thanks to Jonathan Plasse for reporting and fixing this in :pull:`3889`!
.. _v6.98.16:
--------------------
6.98.16 - 2024-03-04
--------------------
This patch paves the way for future shrinker improvements. There is no user-visible change.
.. _v6.98.15:
--------------------
6.98.15 - 2024-02-29
--------------------
This release adds support for the Array API's `2023.12 release
<https://data-apis.org/array-api/2023.12/>`_ via the ``api_version`` argument in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`. The API additions
and modifications in the ``2023.12`` spec do not necessitate any changes in the
Hypothesis strategies, hence there is no distinction between a ``2022.12`` and
``2023.12`` strategies namespace.
.. _v6.98.14:
--------------------
6.98.14 - 2024-02-29
--------------------
This patch adjusts the printing of bundle values to correspond
with their names when using stateful testing.
.. _v6.98.13:
--------------------
6.98.13 - 2024-02-27
--------------------
This patch implements filter-rewriting for :func:`~hypothesis.strategies.text`
and :func:`~hypothesis.strategies.binary` with the :meth:`~re.Pattern.search`,
:meth:`~re.Pattern.match`, or :meth:`~re.Pattern.fullmatch` method of a
:func:`re.compile`\ d regex.
.. _v6.98.12:
--------------------
6.98.12 - 2024-02-25
--------------------
This patch implements filter-rewriting for most length filters on some
additional collection types (:issue:`3795`), and fixes several latent
bugs where unsatisfiable or partially-infeasible rewrites could trigger
internal errors.
.. _v6.98.11:
--------------------
6.98.11 - 2024-02-24
--------------------
This patch makes stateful testing somewhat less likely to get stuck
when there are only a few possible rules.
.. _v6.98.10:
--------------------
6.98.10 - 2024-02-22
--------------------
This patch :pep:`adds a note <678>` to errors which occur while drawing from
a strategy, to make it easier to tell why your test failed in such cases.
.. _v6.98.9:
-------------------
6.98.9 - 2024-02-20
-------------------
This patch ensures that :ref:`observability <observability>` outputs include
an informative repr for :class:`~hypothesis.stateful.RuleBasedStateMachine`
stateful tests, along with more detailed timing information.
.. _v6.98.8:
-------------------
6.98.8 - 2024-02-18
-------------------
This patch improves :ref:`the Ghostwriter <ghostwriter>` for binary operators.
.. _v6.98.7:
-------------------
6.98.7 - 2024-02-18
-------------------
This patch improves import-detection in :ref:`the Ghostwriter <ghostwriter>`
(:issue:`3884`), particularly for :func:`~hypothesis.strategies.from_type`
and strategies from ``hypothesis.extra.*``.
.. _v6.98.6:
-------------------
6.98.6 - 2024-02-15
-------------------
This patch clarifies the documentation on stateful testing (:issue:`3511`).
.. _v6.98.5:
-------------------
6.98.5 - 2024-02-14
-------------------
This patch improves argument-to-json conversion for :ref:`observability <observability>`
output. Checking for a ``.to_json()`` method on the object *before* a few other
options like dataclass support allows better user control of the process (:issue:`3880`).
.. _v6.98.4:
-------------------
6.98.4 - 2024-02-12
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.98.3:
-------------------
6.98.3 - 2024-02-08
-------------------
This patch fixes an error when generating :ref:`observability <observability>` reports involving large (``n > 1e308``) integers.
.. _v6.98.2:
-------------------
6.98.2 - 2024-02-05
-------------------
This patch refactors some internals. There is no user-visible change.
.. _v6.98.1:
-------------------
6.98.1 - 2024-02-05
-------------------
This release improves our distribution of generated values for all strategies, by doing a better job of tracking which values we have generated before and avoiding generating them again.
For example, ``st.lists(st.integers())`` previously generated ~5 each of ``[]`` ``[0]`` in 100 examples. In this release, each of ``[]`` and ``[0]`` are generated ~1-2 times each.
.. _v6.98.0:
-------------------
6.98.0 - 2024-02-05
-------------------
This release deprecates use of the global random number generator while drawing
from a strategy, because this makes test cases less diverse and prevents us
from reporting minimal counterexamples (:issue:`3810`).
If you see this new warning, you can get a quick fix by using
:func:`~hypothesis.strategies.randoms`; or use more idiomatic strategies
:func:`~hypothesis.strategies.sampled_from`, :func:`~hypothesis.strategies.floats`,
:func:`~hypothesis.strategies.integers`, and so on.
Note that the same problem applies to e.g. ``numpy.random``, but
for performance reasons we only check the stdlib :mod:`random` module -
ignoring even other sources passed to :func:`~hypothesis.register_random`.
.. _v6.97.6:
-------------------
6.97.6 - 2024-02-04
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.97.5:
-------------------
6.97.5 - 2024-02-03
-------------------
This patch adds some :ref:`observability information <observability>`
about how many times predicates in :func:`~hypothesis.assume` or
:func:`~hypothesis.stateful.precondition` were satisfied, so that
downstream tools can warn you if some were *never* satisfied by
any test case.
.. _v6.97.4:
-------------------
6.97.4 - 2024-01-31
-------------------
This patch improves formatting and adds some cross-references to our docs.
.. _v6.97.3:
-------------------
6.97.3 - 2024-01-30
-------------------
Internal test refactoring.
.. _v6.97.2:
-------------------
6.97.2 - 2024-01-30
-------------------
This patch slightly changes how we replay examples from
:ref:`the database <database>`: if the behavior of the saved example has
changed, we now keep running the test case instead of aborting at the size
of the saved example. While we know it's not the *same* example, we might
as well continue running the test!
Because we now finish running a few more examples for affected tests, this
might be a slight slowdown - but correspondingly more likely to find a bug.
We've also applied similar tricks to the |Phase.target| phase, where
they are a pure performance improvement for affected tests.
.. _v6.97.1:
-------------------
6.97.1 - 2024-01-27
-------------------
Improves the performance of the :func:`~hypothesis.extra.numpy.arrays`
strategy when generating unique values.
.. _v6.97.0:
-------------------
6.97.0 - 2024-01-25
-------------------
Changes the distribution of :func:`~hypothesis.strategies.sampled_from` when
sampling from a :class:`~python:enum.Flag`. Previously, no-flags-set values would
never be generated, and all-flags-set values would be unlikely for large enums.
With this change, the distribution is more uniform in the number of flags set.
.. _v6.96.4:
-------------------
6.96.4 - 2024-01-23
-------------------
This patch slightly refactors some internals. There is no user-visible change.
.. _v6.96.3:
-------------------
6.96.3 - 2024-01-22
-------------------
This patch fixes a spurious warning about slow imports when ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY`` was set.
.. _v6.96.2:
-------------------
6.96.2 - 2024-01-21
-------------------
This patch refactors some more internals, continuing our work on supporting alternative backends (:issue:`3086`). There is no user-visible change.
.. _v6.96.1:
-------------------
6.96.1 - 2024-01-18
-------------------
Fix a spurious warning seen when running pytest's test
suite, caused by never realizing we got out of
initialization due to imbalanced hook calls.
.. _v6.96.0:
-------------------
6.96.0 - 2024-01-17
-------------------
Warns when constructing a `repr` that is overly long. This can
happen by accident if stringifying arbitrary strategies, and
is expensive in time and memory. The associated deferring of
these long strings in :func:`~hypothesis.strategies.sampled_from`
should also lead to improved performance.
.. _v6.95.0:
-------------------
6.95.0 - 2024-01-17
-------------------
This release adds the ability to pass any object to :func:`~hypothesis.note`, instead of just strings. The pretty-printed representation of the object will be used.
See also :issue:`3843`.
.. _v6.94.0:
-------------------
6.94.0 - 2024-01-16
-------------------
This release avoids creating a ``.hypothesis`` directory when using
:func:`~hypothesis.strategies.register_type_strategy` (:issue:`3836`),
and adds warnings for plugins which do so by other means or have
other unintended side-effects.
.. _v6.93.2:
-------------------
6.93.2 - 2024-01-15
-------------------
This patch improves :ref:`observability <observability>` reports by moving
timing information from ``metadata`` to a new ``timing`` key, and supporting
conversion of additional argument types to json rather than string reprs
via a ``.to_json()`` method (including e.g. Pandas dataframes).
Additionally, the :obj:`~hypothesis.HealthCheck.too_slow` health check will
now report *which* strategies were slow, e.g. for strategies a, b, c, ...::
count | fraction | slowest draws (seconds)
a | 3 | 65% | -- -- -- 0.357, 2.000
b | 8 | 16% | 0.100, 0.100, 0.100, 0.111, 0.123
c | 3 | 8% | -- -- 0.030, 0.050, 0.200
(skipped 2 rows of fast draws)
.. _v6.93.1:
-------------------
6.93.1 - 2024-01-15
-------------------
This patch refactors some internals, continuing our work on supporting alternative backends
(:issue:`3086`). There is no user-visible change.
.. _v6.93.0:
-------------------
6.93.0 - 2024-01-13
-------------------
The :func:`~hypothesis.extra.lark.from_lark` strategy now accepts an ``alphabet=``
argument, which is passed through to :func:`~hypothesis.strategies.from_regex`,
so that you can e.g. constrain the generated strings to a particular codec.
In support of this feature, :func:`~hypothesis.strategies.from_regex` will avoid
generating optional parts which do not fit the alphabet. For example,
``from_regex(r"abc|def", alphabet="abcd")`` was previously an error, and will now
generate only ``'abc'``. Cases where there are no valid strings remain an error.
.. _v6.92.9:
-------------------
6.92.9 - 2024-01-12
-------------------
This patch refactors some internals, continuing our work on supporting alternative backends (:issue:`3086`). There is no user-visible change.
.. _v6.92.8:
-------------------
6.92.8 - 2024-01-11
-------------------
This patch adds a :ref:`test statistics <statistics>` event when a generated example is rejected via :func:`assume <hypothesis.assume>`.
This may also help with distinguishing ``gave_up`` examples in :ref:`observability <observability>` (:issue:`3827`).
.. _v6.92.7:
-------------------
6.92.7 - 2024-01-10
-------------------
This introduces the rewriting of length filters on some collection strategies (:issue:`3791`).
Thanks to Reagan Lee for implementing this feature!
.. _v6.92.6:
-------------------
6.92.6 - 2024-01-08
-------------------
If a test uses :func:`~hypothesis.strategies.sampled_from` on a sequence of
strategies, and raises a ``TypeError``, we now :pep:`add a note <678>` asking
whether you meant to use :func:`~hypothesis.strategies.one_of`.
Thanks to Vince Reuter for suggesting and implementing this hint!
.. _v6.92.5:
-------------------
6.92.5 - 2024-01-08
-------------------
This patch registers explicit strategies for a handful of builtin types,
motivated by improved introspection in PyPy 7.3.14 triggering existing
internal warnings.
Thanks to Carl Friedrich Bolz-Tereick for helping us work out what changed!
.. _v6.92.4:
-------------------
6.92.4 - 2024-01-08
-------------------
This patch fixes an error when writing :ref:`observability <observability>` reports without a pre-existing ``.hypothesis`` directory.
.. _v6.92.3:
-------------------
6.92.3 - 2024-01-08
-------------------
This patch adds a new environment variable ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY_NOCOVER``,
which turns on :ref:`observability <observability>` data collection without collecting
code coverage data, which may be faster on Python 3.11 and earlier.
Thanks to Harrison Goldstein for reporting and fixing :issue:`3821`.
.. _v6.92.2:
-------------------
6.92.2 - 2023-12-27
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.92.1:
-------------------
6.92.1 - 2023-12-16
-------------------
This patch fixes a bug introduced in :ref:`version 6.92.0 <v6.92.0>`,
where using the :func:`~hypothesis.strategies.data` strategy would fail
to draw a :func:`~python:dataclasses.dataclass` with a
:class:`~python:collections.defaultdict` field. This was due to a bug
in the standard library which `was fixed in 3.12
<https://github.com/python/cpython/pull/32056>`__, so we've vendored the fix.
.. _v6.92.0:
-------------------
6.92.0 - 2023-12-10
-------------------
This release adds an experimental :wikipedia:`observability <Observability_(software)>`
mode. :ref:`You can read the docs about it here <observability>`.
.. _v6.91.2:
-------------------
6.91.2 - 2023-12-10
-------------------
This patch refactors some more internals, continuing our work on supporting alternative backends (:issue:`3086`). There is no user-visible change.
.. _v6.91.1:
-------------------
6.91.1 - 2023-12-08
-------------------
This patch fixes an issue where :func:`~hypothesis.strategies.builds` could not be used with :pypi:`attrs` objects that defined private attributes (i.e. attributes with a leading underscore). See also :issue:`3791`.
This patch also adds support more generally for using :func:`~hypothesis.strategies.builds` with attrs' ``alias`` parameter, which was previously unsupported.
This patch increases the minimum required version of attrs to 22.2.0.
.. _v6.91.0:
-------------------
6.91.0 - 2023-11-27
-------------------
This release adds an optional ``payload`` argument to :func:`hypothesis.event`,
so that you can clearly express the difference between the label and the value
of an observation. :ref:`statistics` will still summarize it as a string, but
future observability options can preserve the distinction.
.. _v6.90.1:
-------------------
6.90.1 - 2023-11-27
-------------------
This patch supports assigning ``settings = settings(...)`` as a class attribute
on a subclass of a ``.TestCase`` attribute of a :class:`~hypothesis.stateful.RuleBasedStateMachine`.
Previously, this did nothing at all.
.. code-block:: python
# works as of this release
class TestMyStatefulMachine(MyStatefulMachine.TestCase):
settings = settings(max_examples=10000)
# the old way still works, but it's more verbose.
MyStateMachine.TestCase.settings = settings(max_examples=10000)
class TestMyStatefulMachine(MyStatefulMachine.TestCase):
pass
Thanks to Joey Tran for reporting these settings-related edge cases in stateful testing.
.. _v6.90.0:
-------------------
6.90.0 - 2023-11-20
-------------------
This release makes it an error to assign ``settings = settings(...)``
as a class attribute on a :class:`~hypothesis.stateful.RuleBasedStateMachine`.
This has never had any effect, and it should be used as a decorator instead:
.. code-block:: python
class BadMachine(RuleBasedStateMachine):
"""This doesn't do anything, and is now an error!"""
settings = settings(derandomize=True)
@settings(derandomize=True)
class GoodMachine(RuleBasedStateMachine):
"""This is the right way to do it :-)"""
.. _v6.89.1:
-------------------
6.89.1 - 2023-11-19
-------------------
This patch refactors some internals. There is no user-visible change,
but we hope to improve performance and unlock support for alternative
backends such as :pypi:`symbolic execution with crosshair <crosshair-tool>`
in future (:issue:`3086`).
Thanks to Liam DeVoe for this fantastic contribution!
.. _v6.89.0:
-------------------
6.89.0 - 2023-11-16
-------------------
This release teaches :func:`~hypothesis.strategies.from_type` to handle constraints
implied by the :pypi:`annotated-types` package - as used by e.g. :pypi:`pydantic`.
This is usually efficient, but falls back to filtering in a few remaining cases.
Thanks to Viicos for :pull:`3780`!
.. _v6.88.4:
-------------------
6.88.4 - 2023-11-13
-------------------
This patch adds a warning when :func:`@st.composite <hypothesis.strategies.composite>`
wraps a function annotated as returning a :class:`~hypothesis.strategies.SearchStrategy`,
since this is usually an error (:issue:`3786`). The function should return a value,
and the decorator will convert it to a function which returns a strategy.
.. _v6.88.3:
-------------------
6.88.3 - 2023-11-05
-------------------
This patch refactors ``from_type(typing.Tuple)``, allowing
:func:`~hypothesis.strategies.register_type_strategy` to take effect
for tuples instead of being silently ignored (:issue:`3750`).
Thanks to Nick Collins for reporting and extensive work on this issue.
.. _v6.88.2:
-------------------
6.88.2 - 2023-11-05
-------------------
This patch improves the speed of the explain phase on python 3.12+, by using the new
:mod:`sys.monitoring` module to collect coverage, instead of :obj:`sys.settrace`.
Thanks to Liam DeVoe for :pull:`3776`!
.. _v6.88.1:
-------------------
6.88.1 - 2023-10-16
-------------------
This patch improves :func:`~hypothesis.strategies.register_type_strategy` when used with ``tuple`` subclasses,
by preventing them from being interpreted as generic and provided to strategies like ``st.from_type(Sequence[int])``
(:issue:`3767`).
.. _v6.88.0:
-------------------
6.88.0 - 2023-10-15
-------------------
This release allows strategy-generating functions registered with
:func:`~hypothesis.strategies.register_type_strategy` to conditionally not
return a strategy, by returning :data:`NotImplemented` (:issue:`3767`).
.. _v6.87.4:
-------------------
6.87.4 - 2023-10-12
-------------------
When :func:`~hypothesis.strategies.randoms` was called with ``use_true_randoms=False``,
calling ``r.sample([], 0)`` would result in an error,
when it should have returned an empty sequence to agree with the normal behaviour of
:func:`random.sample`. This fixes that discrepancy (:issue:`3765`).
.. _v6.87.3:
-------------------
6.87.3 - 2023-10-06
-------------------
This patch ensures that the :ref:`hypothesis codemod <codemods>` CLI
will print a warning instead of stopping with an internal error if
one of your files contains invalid syntax (:issue:`3759`).
.. _v6.87.2:
-------------------
6.87.2 - 2023-10-06
-------------------
This patch makes some small changes to our NumPy integration to ensure forward
compatibility. Thanks to Mateusz Sokół for :pull:`3761`.
.. _v6.87.1:
-------------------
6.87.1 - 2023-10-01
-------------------
Fixes :issue:`3755`, where an internal condition turns out
to be reachable after all.
.. _v6.87.0:
-------------------
6.87.0 - 2023-09-25
-------------------
This release deprecates use of :func:`~hypothesis.assume` and ``reject()``
outside of property-based tests, because these functions work by raising a
special exception (:issue:`3743`). It also fixes some type annotations
(:issue:`3753`).
.. _v6.86.2:
-------------------
6.86.2 - 2023-09-18
-------------------
Hotfix for :issue:`3747`, a bug in explain mode which is so rare that
we missed it in six months of dogfooding. Thanks to :pypi:`mygrad`
for discovering and promptly reporting this!
.. _v6.86.1:
-------------------
6.86.1 - 2023-09-17
-------------------
This patch improves the documentation of :obj:`@example(...).xfail() <hypothesis.example.xfail>`
by adding a note about :pep:`614`, similar to :obj:`@example(...).via() <hypothesis.example.via>`,
and adds a warning when a strategy generates a test case which seems identical to
one provided by an xfailed example.
.. _v6.86.0:
-------------------
6.86.0 - 2023-09-17
-------------------
This release enables the |Phase.explain| phase
by default. We hope it helps you to understand *why* your failing tests have
failed!
.. _v6.85.1:
-------------------
6.85.1 - 2023-09-16
-------------------
This patch switches some of our type annotations to use :obj:`typing.Literal`
when only a few specific values are allowed, such as UUID or IP address versions.
.. _v6.85.0:
-------------------
6.85.0 - 2023-09-16
-------------------
This release deprecates the old whitelist/blacklist arguments
to :func:`~hypothesis.strategies.characters`, in favor of
include/exclude arguments which more clearly describe their
effects on the set of characters which can be generated.
You can :ref:`use Hypothesis' codemods <codemods>` to automatically
upgrade to the new argument names. In a future version, the old
names will start to raise a ``DeprecationWarning``.
.. _v6.84.3:
-------------------
6.84.3 - 2023-09-10
-------------------
This patch automatically disables the :obj:`~hypothesis.HealthCheck.differing_executors`
health check for methods which are also pytest parametrized tests, because
those were mostly false alarms (:issue:`3733`).
.. _v6.84.2:
-------------------
6.84.2 - 2023-09-06
-------------------
Building on recent releases, :func:`~hypothesis.strategies.characters`
now accepts _any_ ``codec=``, not just ``"utf-8"`` and ``"ascii"``.
This includes standard codecs from the :mod:`codecs` module and their
aliases, platform specific and user-registered codecs if they are
available, and `python-specific text encodings
<https://docs.python.org/3/library/codecs.html#python-specific-encodings>`__
(but not text transforms or binary transforms).
.. _v6.84.1:
-------------------
6.84.1 - 2023-09-05
-------------------
This patch by Reagan Lee makes ``st.text(...).filter(str.isidentifier)``
return an efficient custom strategy (:issue:`3480`).
.. _v6.84.0:
-------------------
6.84.0 - 2023-09-04
-------------------
The :func:`~hypothesis.strategies.from_regex` strategy now takes an optional
``alphabet=characters(codec="utf-8")`` argument for unicode strings, like
:func:`~hypothesis.strategies.text`.
This offers more and more-consistent control over the generated strings,
removing previously-hard-coded limitations. With ``fullmatch=False`` and
``alphabet=characters()``, surrogate characters are now possible in leading
and trailing text as well as the body of the match. Negated character classes
such as ``[^A-Z]`` or ``\S`` had a hard-coded exclusion of control characters
and surrogate characters; now they permit anything in ``alphabet=`` consistent
with the class, and control characters are permitted by default.
.. _v6.83.2:
-------------------
6.83.2 - 2023-09-04
-------------------
Add a health check that detects if the same test is executed
several times by :ref:`different executors<custom-function-execution>`.
This can lead to difficult-to-debug problems such as :issue:`3446`.
.. _v6.83.1:
-------------------
6.83.1 - 2023-09-03
-------------------
Pretty-printing of failing examples can now use functions registered with
:func:`IPython.lib.pretty.for_type` or :func:`~IPython.lib.pretty.for_type_by_name`,
as well as restoring compatibility with ``_repr_pretty_`` callback methods
which were accidentally broken in :ref:`version 6.61.2 <v6.61.2>` (:issue:`3721`).
.. _v6.83.0:
-------------------
6.83.0 - 2023-09-01
-------------------
Adds a new ``codec=`` option in :func:`~hypothesis.strategies.characters`, making it
convenient to produce only characters which can be encoded as ``ascii`` or ``utf-8``
bytestrings.
Support for other codecs will be added in a future release.
.. _v6.82.7:
-------------------
6.82.7 - 2023-08-28
-------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.82.6:
-------------------
6.82.6 - 2023-08-20
-------------------
This patch enables and fixes many more of :pypi:`ruff`\ 's lint rules.
.. _v6.82.5:
-------------------
6.82.5 - 2023-08-18
-------------------
Fixes the error message for missing ``[cli]`` extra.
.. _v6.82.4:
-------------------
6.82.4 - 2023-08-12
-------------------
This patch ensures that we always close the download connection in
:class:`~hypothesis.database.GitHubArtifactDatabase`.
.. _v6.82.3:
-------------------
6.82.3 - 2023-08-08
-------------------
We can now pretty-print combinations of *zero* :class:`enum.Flag`
values, like ``SomeFlag(0)``, which has never worked before.
.. _v6.82.2:
-------------------
6.82.2 - 2023-08-06
-------------------
This patch fixes pretty-printing of combinations of :class:`enum.Flag`
values, which was previously an error (:issue:`3709`).
.. _v6.82.1:
-------------------
6.82.1 - 2023-08-05
-------------------
Improve shrinking of floats in narrow regions that don't cross an integer
boundary. Closes :issue:`3357`.
.. _v6.82.0:
-------------------
6.82.0 - 2023-07-20
-------------------
:func:`~hypothesis.strategies.from_regex` now supports the atomic grouping
(``(?>...)``) and possessive quantifier (``*+``, ``++``, ``?+``, ``{m,n}+``)
syntax `added in Python 3.11 <https://docs.python.org/3/whatsnew/3.11.html#re>`__.
Thanks to Cheuk Ting Ho for implementing this!
.. _v6.81.2:
-------------------
6.81.2 - 2023-07-15
-------------------
If the :envvar:`HYPOTHESIS_NO_PLUGINS` environment variable is set, we'll avoid
:ref:`loading plugins <entry-points>` such as `the old Pydantic integration
<https://docs.pydantic.dev/latest/integrations/hypothesis/>`__ or
`HypoFuzz' CLI options <https://hypofuzz.com/docs/quickstart.html#running-hypothesis-fuzz>`__.
This is probably only useful for our own self-tests, but documented in case it might
help narrow down any particularly weird bugs in complex environments.
.. _v6.81.1:
-------------------
6.81.1 - 2023-07-11
-------------------
Fixes some lingering issues with inference of recursive types
in :func:`~hypothesis.strategies.from_type`. Closes :issue:`3525`.
.. _v6.81.0:
-------------------
6.81.0 - 2023-07-10
-------------------
This release further improves our ``.patch``-file support from
:ref:`version 6.75 <v6.75.0>`, skipping duplicates, tests which use
:func:`~hypothesis.strategies.data` (and don't support
:obj:`@example() <hypothesis.example>`\ ), and various broken edge-cases.
Because :pypi:`libCST <libcst>` has released version 1.0 which uses the native parser
by default, we no longer set the ``LIBCST_PARSER_TYPE=native`` environment
variable. If you are using an older version, you may need to upgrade or
set this envvar for yourself.
.. _v6.80.1:
-------------------
6.80.1 - 2023-07-06
-------------------
This patch updates some internal code for selftests.
There is no user-visible change.
.. _v6.80.0:
-------------------
6.80.0 - 2023-06-27
-------------------
This release drops support for Python 3.7, `which reached end of life on
2023-06-27 <https://devguide.python.org/versions/>`__.
.. _v6.79.4:
-------------------
6.79.4 - 2023-06-27
-------------------
Fixes occasional recursion-limit-exceeded errors when validating
deeply nested strategies. Closes: :issue:`3671`
.. _v6.79.3:
-------------------
6.79.3 - 2023-06-26
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.79.2:
-------------------
6.79.2 - 2023-06-22
-------------------
Improve the type rendered in :func:`~hypothesis.strategies.from_type`,
which improves the coverage of Ghostwriter.
.. _v6.79.1:
-------------------
6.79.1 - 2023-06-19
-------------------
We now test against Python 3.12 beta in CI, and this patch
fixes some new deprecations.
.. _v6.79.0:
-------------------
6.79.0 - 2023-06-17
-------------------
This release changes :func:`~hypothesis.strategies.register_type_strategy`
for compatibility with :pep:`585`: we now store only a single strategy or
resolver function which is used for both the builtin and the ``typing``
module version of each type (:issue:`3635`).
If you previously relied on registering separate strategies for e.g.
``list`` vs ``typing.List``, you may need to use explicit strategies
rather than inferring them from types.
.. _v6.78.3:
-------------------
6.78.3 - 2023-06-15
-------------------
This release ensures that Ghostwriter does not use the deprecated aliases
for the ``collections.abc`` classes in ``collections``.
.. _v6.78.2:
-------------------
6.78.2 - 2023-06-13
-------------------
This patch improves Ghostwriter's use of qualified names for re-exported
functions and classes, and avoids importing useless :obj:`~typing.TypeVar`\ s.
.. _v6.78.1:
-------------------
6.78.1 - 2023-06-12
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.78.0:
-------------------
6.78.0 - 2023-06-11
-------------------
New input validation for :func:`~hypothesis.strategies.recursive`
will raise an error rather than hanging indefinitely if passed
invalid ``max_leaves=`` arguments.
.. _v6.77.0:
-------------------
6.77.0 - 2023-06-09
-------------------
:func:`~hypothesis.strategies.from_type` now handles numpy array types:
:obj:`np.typing.ArrayLike <numpy.typing.ArrayLike>`,
:obj:`np.typing.NDArray <numpy.typing.NDArray>`, and parameterized
versions including :class:`np.ndarray[shape, elem_type] <numpy.ndarray>`.
.. _v6.76.0:
-------------------
6.76.0 - 2023-06-04
-------------------
Warn in :func:`~hypothesis.strategies.from_type` if the inferred strategy
has no variation (always returning default instances). Also handles numpy
data types by calling :func:`~hypothesis.extra.numpy.from_dtype` on the
corresponding dtype, thus ensuring proper variation for these types.
.. _v6.75.9:
-------------------
6.75.9 - 2023-05-31
-------------------
:func:`~hypothesis.strategies.from_type` now works in cases where we use
:func:`~hypothesis.strategies.builds` to create an instance and the constructor
has an argument which would lead to recursion. Previously, this would raise
an error if the argument had a default value.
Thanks to Joachim B Haga for reporting and fixing this problem.
.. _v6.75.8:
-------------------
6.75.8 - 2023-05-31
-------------------
In preparation for supporting JAX in :ref:`hypothesis.extra.array_api <array-api>`,
this release supports immutable arrays being generated via :func:`xps.arrays`.
In particular, we internally removed an instance of in-place array modification,
which isn't possible for an immutable array.
.. _v6.75.7:
-------------------
6.75.7 - 2023-05-30
-------------------
This release fixes some ``.patch``-file bugs from :ref:`version 6.75 <v6.75.0>`,
and adds automatic support for writing ``@hypothesis.example()`` or ``@example()``
depending on the current style in your test file - defaulting to the latter.
Note that this feature requires :pypi:`libcst` to be installed, and :pypi:`black`
is strongly recommended. You can ensure you have the dependencies with
``pip install "hypothesis[cli,codemods]"``.
.. _v6.75.6:
-------------------
6.75.6 - 2023-05-27
-------------------
This patch continues the work started in :pull:`3651` by adding
:pypi:`ruff` linter rules for :pypi:`pyflakes`, :pypi:`flake8-comprehensions`,
and :pypi:`flake8-implicit-str-concat`.
.. _v6.75.5:
-------------------
6.75.5 - 2023-05-26
-------------------
This patch updates our linter stack to use :pypi:`ruff`, and fixes some
previously-ignored lints. Thanks to Christian Clauss for his careful
review and :pull:`3651`!
.. _v6.75.4:
-------------------
6.75.4 - 2023-05-26
-------------------
Hypothesis will now record an event for more cases where data is marked
invalid, including for exceeding the internal depth limit.
.. _v6.75.3:
-------------------
6.75.3 - 2023-05-14
-------------------
This patch fixes :func:`~hypothesis.strategies.complex_numbers` accidentally
invalidating itself when passed magnitude arguments for 32 and 64-bit widths,
i.e. 16- and 32-bit floats, due to not internally down-casting numbers (:issue:`3573`).
.. _v6.75.2:
-------------------
6.75.2 - 2023-05-04
-------------------
Improved the documentation regarding how to use :class:`~hypothesis.database.GitHubArtifactDatabase`
and fixed a bug that occurred in repositories with no existing artifacts.
Thanks to Agustín Covarrubias for this contribution.
.. _v6.75.1:
-------------------
6.75.1 - 2023-04-30
-------------------
``hypothesis.errors`` will now raise :py:exc:`AttributeError` when attempting
to access an undefined attribute, rather than returning :py:obj:`None`.
.. _v6.75.0:
-------------------
6.75.0 - 2023-04-30
-------------------
Sick of adding :obj:`@example() <hypothesis.example>`\ s by hand?
Our Pytest plugin now writes ``.patch`` files to insert them for you, making
`this workflow <https://blog.nelhage.com/post/property-testing-like-afl/>`__
easier than ever before.
Note that you'll need :pypi:`LibCST <libcst>` (via :ref:`codemods`), and that
:obj:`@example().via() <hypothesis.example.via>` requires :pep:`614`
(Python 3.9 or later).
.. _v6.74.1:
-------------------
6.74.1 - 2023-04-28
-------------------
This patch provides better error messages for datetime- and timedelta-related
invalid dtypes in our Pandas extra (:issue:`3518`).
Thanks to Nick Muoh at the PyCon Sprints!
.. _v6.74.0:
-------------------
6.74.0 - 2023-04-26
-------------------
This release adds support for `nullable pandas dtypes <https://pandas.pydata.org/docs/user_guide/integer_na.html>`__
in :func:`~hypothesis.extra.pandas` (:issue:`3604`).
Thanks to Cheuk Ting Ho for implementing this at the PyCon sprints!
.. _v6.73.1:
-------------------
6.73.1 - 2023-04-27
-------------------
This patch updates our minimum Numpy version to 1.16, and restores compatibility
with versions before 1.20, which were broken by a mistake in Hypothesis 6.72.4
(:issue:`3625`).
.. _v6.73.0:
-------------------
6.73.0 - 2023-04-25
-------------------
This release upgrades the |Phase.explain| phase (:issue:`3411`).
* Following the first failure, Hypothesis will (usually, depending on the enabled |Phase|) track which
lines of code were executed by passing and failing examples, and report where they
diverged - with some heuristics to drop unhelpful reports. This is an existing
feature, now upgraded and newly enabled by default.
* After shrinking to a minimal failing example, Hypothesis will try to find parts of
the example -- e.g. separate args to :func:`@given() <hypothesis.given>` -- which
can vary freely without changing the result of that minimal failing example.
If the automated experiments run without finding a passing variation, we leave a
comment in the final report:
.. code-block:: python
test_x_divided_by_y(
x=0, # or any other generated value
y=0,
)
Just remember that the *lack* of an explanation sometimes just means that Hypothesis
couldn't efficiently find one, not that no explanation (or simpler failing example)
exists.
.. _v6.72.4:
-------------------
6.72.4 - 2023-04-25
-------------------
This patch fixes type annotations for the :func:`~hypothesis.extra.numpy.arrays`
strategy. Thanks to Francesc Elies for :pull:`3602`.
.. _v6.72.3:
-------------------
6.72.3 - 2023-04-25
-------------------
This patch fixes a bug with :func:`~hypothesis.strategies.from_type()` with ``dict[tuple[int, int], str]``
(:issue:`3527`). Thanks to Nick Muoh at the PyCon Sprints!
.. _v6.72.2:
-------------------
6.72.2 - 2023-04-24
-------------------
This patch refactors our internals to facilitate an upcoming feature.
.. _v6.72.1:
-------------------
6.72.1 - 2023-04-19
-------------------
This patch fixes some documentation and prepares for future features.
.. _v6.72.0:
-------------------
6.72.0 - 2023-04-16
-------------------
This release deprecates ``Healthcheck.all()``, and :ref:`adds a codemod <codemods>`
to automatically replace it with ``list(Healthcheck)`` (:issue:`3596`).
.. _v6.71.0:
-------------------
6.71.0 - 2023-04-07
-------------------
This release adds :class:`~hypothesis.database.GitHubArtifactDatabase`, a new database
backend that allows developers to access the examples found by a Github Actions CI job.
This is particularly useful for workflows that involve continuous fuzzing,
like `HypoFuzz <https://hypofuzz.com/>`__.
Thanks to Agustín Covarrubias for this feature!
.. _v6.70.2:
-------------------
6.70.2 - 2023-04-03
-------------------
This patch clarifies the reporting of time spent generating data. A
simple arithmetic mean of the percentage of time spent can be
misleading; reporting the actual time spent avoids misunderstandings.
Thanks to Andrea Reina for reporting and fixing :issue:`3598`!
.. _v6.70.1:
-------------------
6.70.1 - 2023-03-27
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.70.0:
-------------------
6.70.0 - 2023-03-16
-------------------
This release adds an optional ``domains=`` parameter to the
:func:`~hypothesis.strategies.emails` strategy, and excludes
the special-use :wikipedia:`.arpa` domain from the default
strategy (:issue:`3567`).
Thanks to Jens Tröger for reporting and fixing this bug!
.. _v6.69.0:
-------------------
6.69.0 - 2023-03-15
-------------------
This release turns ``HealthCheck.return_value`` and ``HealthCheck.not_a_test_method``
into unconditional errors. Passing them to ``suppress_health_check=`` is therefore a deprecated no-op.
(:issue:`3568`). Thanks to Reagan Lee for the patch!
Separately, GraalPy can now run and pass most of the hypothesis test suite (:issue:`3587`).
.. _v6.68.3:
-------------------
6.68.3 - 2023-03-15
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.68.2:
-------------------
6.68.2 - 2023-02-17
-------------------
This patch fixes missing imports of the :mod:`re` module, when :ref:`ghostwriting <ghostwriter>`
tests which include compiled patterns or regex flags.
Thanks to Jens Heinrich for reporting and promptly fixing this bug!
.. _v6.68.1:
-------------------
6.68.1 - 2023-02-12
-------------------
This patch adds some private hooks for use in research on
`Schemathesis <https://github.com/schemathesis/schemathesis>`__
(`see our preprint here <https://arxiv.org/abs/2112.10328>`__).
.. _v6.68.0:
-------------------
6.68.0 - 2023-02-09
-------------------
This release adds support for the Array API's `2022.12 release
<https://data-apis.org/array-api/2022.12/>`_ via the ``api_version`` argument in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`. Concretely this
involves complex support in its existing strategies, plus an introduced
:func:`xps.complex_dtypes` strategy.
Additionally this release now treats :ref:`hypothesis.extra.array_api
<array-api>` as stable, meaning breaking changes should only happen with major
releases of Hypothesis.
.. _v6.67.1:
-------------------
6.67.1 - 2023-02-05
-------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.67.0:
-------------------
6.67.0 - 2023-02-05
-------------------
This release allows for more precise generation of complex numbers using
:func:`~hypothesis.extra.numpy.from_dtype`, by supporting the ``width``,
``min_magnitude``, and ``min_magnitude`` arguments (:issue:`3468`).
Thanks to Felix Divo for this feature!
.. _v6.66.2:
-------------------
6.66.2 - 2023-02-04
-------------------
This patch fixes a rare ``RecursionError`` when pretty-printing a multi-line
object without type-specific printer, which was passed to a function which
returned the same object by ``.map()`` or :func:`~hypothesis.strategies.builds`
and thus recursed due to the new pretty reprs in Hypothesis :ref:`v6.65.0`
(:issue:`3560`). Apologies to all those affected.
.. _v6.66.1:
-------------------
6.66.1 - 2023-02-03
-------------------
This makes :func:`~hypothesis.extra.numpy.from_dtype` pass through the parameter
``allow_subnormal`` for complex dtypes.
.. _v6.66.0:
-------------------
6.66.0 - 2023-02-02
-------------------
This release adds a ``width`` parameter to :func:`~hypothesis.strategies.complex_numbers`,
analogously to :func:`~hypothesis.strategies.floats`.
Thanks to Felix Divo for the new feature!
.. _v6.65.2:
-------------------
6.65.2 - 2023-01-27
-------------------
This patch fixes invalid annotations detected for the tests generated by
:ref:`Ghostwritter <ghostwriter>`. It will now correctly generate ``Optional``
types with just one type argument and handle union expressions inside of type
arguments correctly. Additionally, it now supports code with the
``from __future__ import annotations`` marker for Python 3.10 and newer.
.. _v6.65.1:
-------------------
6.65.1 - 2023-01-26
-------------------
This release improves the pretty-printing of enums in falsifying examples,
so that they print as their full identifier rather than their repr.
.. _v6.65.0:
-------------------
6.65.0 - 2023-01-24
-------------------
Hypothesis now reports some failing inputs by showing the call which constructed
an object, rather than the repr of the object. This can be helpful when the default
repr does not include all relevant details, and will unlock further improvements
in a future version.
For now, we capture calls made via :func:`~hypothesis.strategies.builds`, and via
|.map|.
.. _v6.64.0:
-------------------
6.64.0 - 2023-01-23
-------------------
The :ref:`Ghostwritter <ghostwriter>` will now include type annotations on tests
for type-annotated code. If you want to force this to happen (or not happen),
pass a boolean to the new ``annotate=`` argument to the Python functions, or
the ``--[no-]annotate`` CLI flag.
Thanks to Nicolas Ganz for this new feature!
.. _v6.63.0:
-------------------
6.63.0 - 2023-01-20
-------------------
:func:`~hypothesis.extra.pandas.range_indexes` now accepts a ``name=`` argument,
to generate named :class:`pandas.RangeIndex` objects.
Thanks to Sam Watts for this new feature!
.. _v6.62.1:
-------------------
6.62.1 - 2023-01-14
-------------------
This patch tweaks :func:`xps.arrays` internals to improve PyTorch compatibility.
Specifically, ``torch.full()`` does not accept integers as the shape argument
(n.b. technically "size" in torch), but such behaviour is expected in internal
code, so we copy the ``torch`` module and patch in a working ``full()`` function.
.. _v6.62.0:
-------------------
6.62.0 - 2023-01-08
-------------------
A classic error when testing is to write a test function that can never fail,
even on inputs that aren't allowed or manually provided. By analogy to the
design pattern of::
@pytest.mark.parametrize("arg", [
..., # passing examples
pytest.param(..., marks=[pytest.mark.xfail]) # expected-failing input
])
we now support :obj:`@example(...).xfail() <hypothesis.example.xfail>`, with
the same (optional) ``condition``, ``reason``, and ``raises`` arguments as
``pytest.mark.xfail()``.
Naturally you can also write ``.via(...).xfail(...)``, or ``.xfail(...).via(...)``,
if you wish to note the provenance of expected-failing examples.
.. _v6.61.3:
-------------------
6.61.3 - 2023-01-08
-------------------
This patch teaches our enhanced :func:`~typing.get_type_hints` function to
'see through' :obj:`~functools.partial` application, allowing inference
from type hints to work in a few more cases which aren't (yet!) supported
by the standard-library version.
.. _v6.61.2:
-------------------
6.61.2 - 2023-01-07
-------------------
This patch improves our pretty-printing of failing examples, including
some refactoring to prepare for exciting future features.
.. _v6.61.1:
-------------------
6.61.1 - 2023-01-06
-------------------
This patch brings our :func:`~hypothesis.provisional.domains` and
:func:`~hypothesis.strategies.emails` strategies into compliance with
:rfc:`RFC 5890 §2.3.1 <5890>`: we no longer generate parts-of-domains
where the third and fourth characters are ``--`` ("R-LDH labels"),
though future versions *may* deliberately generate ``xn--`` punycode
labels. Thanks to :pypi:`python-email-validator` for `the report
<https://github.com/JoshData/python-email-validator/issues/92>`__!
.. _v6.61.0:
-------------------
6.61.0 - 2022-12-11
-------------------
This release improves our treatment of database keys, which based on (among other things)
the source code of your test function. We now post-process this source to ignore
decorators, comments, trailing whitespace, and blank lines - so that you can add
:obj:`@example() <hypothesis.example>`\ s or make some small no-op edits to your code
without preventing replay of any known failing or covering examples.
.. _v6.60.1:
-------------------
6.60.1 - 2022-12-11
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.60.0:
-------------------
6.60.0 - 2022-12-04
-------------------
This release improves Hypothesis' ability to resolve forward references in
type annotations. It fixes a bug that prevented
:func:`~hypothesis.strategies.builds` from being used with `pydantic models that
possess updated forward references <https://pydantic-docs.helpmanual.io/usage/postponed_annotations/>`__. See :issue:`3519`.
.. _v6.59.0:
-------------------
6.59.0 - 2022-12-02
-------------------
The :obj:`@example(...) <hypothesis.example>` decorator now has a ``.via()``
method, which future tools will use to track automatically-added covering
examples (:issue:`3506`).
.. _v6.58.2:
-------------------
6.58.2 - 2022-11-30
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.58.1:
-------------------
6.58.1 - 2022-11-26
-------------------
This patch shifts ``hypothesis[lark]`` from depending on the old :pypi:`lark-parser`
package to the new :pypi:`lark` package. There are no code changes in Hypothesis,
it's just that Lark got a new name on PyPI for version 1.0 onwards.
.. _v6.58.0:
-------------------
6.58.0 - 2022-11-19
-------------------
:func:`~hypothesis.register_random` has used :mod:`weakref` since :ref:`v6.27.1`,
allowing the :class:`~random.Random`-compatible objects to be garbage-collected when
there are no other references remaining in order to avoid memory leaks.
We now raise an error or emit a warning when this seems likely to happen immediately.
The type annotation of :func:`~hypothesis.register_random` was also widened so that
structural subtypes of :class:`~random.Random` are accepted by static typecheckers.
.. _v6.57.1:
-------------------
6.57.1 - 2022-11-14
-------------------
This patch updates some internal type annotations and fixes a formatting bug in the
:obj:`~hypothesis.Phase.explain` phase reporting.
.. _v6.57.0:
-------------------
6.57.0 - 2022-11-14
-------------------
Hypothesis now raises an error if you passed a strategy as the ``alphabet=``
argument to :func:`~hypothesis.strategies.text`, and it generated something
which was not a length-one string. This has never been supported, we're just
adding explicit validation to catch cases like `this StackOverflow question
<https://stackoverflow.com/a/74336909/9297601>`__.
.. _v6.56.4:
-------------------
6.56.4 - 2022-10-28
-------------------
This patch updates some docs, and depends on :pypi:`exceptiongroup` 1.0.0
final to avoid a bug in the previous version.
.. _v6.56.3:
-------------------
6.56.3 - 2022-10-17
-------------------
This patch teaches :func:`~hypothesis.strategies.text` to rewrite a few more
filter predicates (:issue:`3134`). You're unlikely to notice any change.
.. _v6.56.2:
-------------------
6.56.2 - 2022-10-10
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy, and fixes some
incorrect examples in the docs for :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`.
.. _v6.56.1:
-------------------
6.56.1 - 2022-10-05
-------------------
This patch improves the error message when Hypothesis detects "flush to zero"
mode for floating-point: we now report which package(s) enabled this, which
can make debugging much easier. See :issue:`3458` for details.
.. _v6.56.0:
-------------------
6.56.0 - 2022-10-02
-------------------
This release defines ``__bool__()`` on :class:`~hypothesis.strategies.SearchStrategy`.
It always returns ``True``, like before, but also emits a warning to help with
cases where you intended to draw a value (:issue:`3463`).
.. _v6.55.0:
-------------------
6.55.0 - 2022-09-29
-------------------
In preparation for `future versions of the Array API standard
<https://data-apis.org/array-api/latest/future_API_evolution.html>`__,
:func:`~hypothesis.extra.array_api.make_strategies_namespace` now accepts an
optional ``api_version`` argument, which determines the version conformed to by
the returned strategies namespace. If ``None``, the version of the passed array
module ``xp`` is inferred.
This release also introduces :func:`xps.real_dtypes`. This is currently
equivalent to the existing :func:`xps.numeric_dtypes` strategy, but exists
because the latter is expected to include complex numbers in the next version of
the standard.
.. _v6.54.6:
-------------------
6.54.6 - 2022-09-18
-------------------
If multiple explicit examples (from :obj:`@example() <hypothesis.example>`)
raise a Skip exception, for consistency with generated examples we now re-raise
the first instead of collecting them into an ExceptionGroup (:issue:`3453`).
.. _v6.54.5:
-------------------
6.54.5 - 2022-09-05
-------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.54.4:
-------------------
6.54.4 - 2022-08-20
-------------------
This patch fixes some type annotations for Python 3.9 and earlier (:issue:`3397`),
and teaches the |Phase.explain| phase about certain locations it should not
bother reporting (:issue:`3439`).
.. _v6.54.3:
-------------------
6.54.3 - 2022-08-12
-------------------
This patch teaches the Ghostwriter an additional check for function
and class locations that should make it use public APIs more often.
.. _v6.54.2:
-------------------
6.54.2 - 2022-08-10
-------------------
This patch fixes our workaround for `a pytest bug where the inner exceptions in
an ExceptionGroup are not displayed <https://github.com/pytest-dev/pytest/issues/9159>`__
(:issue:`3430`).
.. _v6.54.1:
-------------------
6.54.1 - 2022-08-02
-------------------
This patch makes ``FailedHealthCheck`` and ``DeadlineExceeded`` exceptions
picklable, for compatibility with Django's parallel test runner (:issue:`3426`).
.. _v6.54.0:
-------------------
6.54.0 - 2022-08-02
-------------------
Reporting of :obj:`multiple failing examples <hypothesis.settings.report_multiple_bugs>`
now uses the :pep:`654` `ExceptionGroup <https://docs.python.org/3.11/library/exceptions.html#ExceptionGroup>`__ type, which is provided by the
:pypi:`exceptiongroup` backport on Python 3.10 and earlier (:issue:`3175`).
``hypothesis.errors.MultipleFailures`` is therefore deprecated.
Failing examples and other reports are now stored as :pep:`678` exception notes, which
ensures that they will always appear together with the traceback and other information
about their respective error.
.. _v6.53.0:
-------------------
6.53.0 - 2022-07-25
-------------------
:func:`~hypothesis.extra.django.from_field` now supports ``UsernameField``
from :mod:`django.contrib.auth.forms`.
Thanks to Afonso Silva for reporting and working on :issue:`3417`.
.. _v6.52.4:
-------------------
6.52.4 - 2022-07-22
-------------------
This patch improves the error message when you pass filenames to the :command:`hypothesis write`
CLI, which takes the name of a module or function (e.g. :command:`hypothesis write gzip` or
:command:`hypothesis write package.some_function` rather than :command:`hypothesis write script.py`).
Thanks to Ed Rogers for implementing this as part of the SciPy 2022 sprints!
.. _v6.52.3:
-------------------
6.52.3 - 2022-07-19
-------------------
This patch ensures that the warning for non-interactive ``.example()``
points to your code instead of Hypothesis internals (:issue:`3403`).
Thanks to @jameslamb for this fix.
.. _v6.52.2:
-------------------
6.52.2 - 2022-07-19
-------------------
This patch makes :func:`~hypothesis.strategies.integers` more likely to
generate boundary values for large two-sided intervals (:issue:`2942`).
.. _v6.52.1:
-------------------
6.52.1 - 2022-07-18
-------------------
This patch adds filter rewriting for :func:`math.isfinite`, :func:`math.isinf`, and :func:`math.isnan`
on :func:`~hypothesis.strategies.integers` or :func:`~hypothesis.strategies.floats` (:issue:`2701`).
Thanks to Sam Clamons at the SciPy Sprints!
.. _v6.52.0:
-------------------
6.52.0 - 2022-07-18
-------------------
This release adds the ``allow_subnormal`` argument to :func:`~hypothesis.strategies.complex_numbers` by
applying it to each of the real and imaginary parts separately. Closes :issue:`3390`.
Thanks to Evan Tey for this fix.
.. _v6.51.0:
-------------------
6.51.0 - 2022-07-17
-------------------
Issue a deprecation warning if a function decorated with
:func:`@composite <hypothesis.strategies.composite>`
does not draw any values (:issue:`3384`).
Thanks to Grzegorz Zieba, Rodrigo Girão, and Thomas Ball for
working on this at the EuroPython sprints!
.. _v6.50.1:
-------------------
6.50.1 - 2022-07-09
-------------------
This patch improves the error messages in :obj:`@example() <hypothesis.example>`
argument validation following the recent release of :ref:`6.49.1 <v6.49.1>`.
.. _v6.50.0:
-------------------
6.50.0 - 2022-07-09
-------------------
This release allows :func:`~hypothesis.extra.numpy.from_dtype` to generate
Unicode strings which cannot be encoded in UTF-8, but are valid in Numpy
arrays (which use UTF-32).
This logic will only be used with :pypi:`numpy` >= 1.19, because earlier
versions have `an issue <https://github.com/numpy/numpy/issues/15363>`__
which led us to revert :ref:`Hypothesis 5.2 <v5.2.0>` last time!
.. _v6.49.1:
-------------------
6.49.1 - 2022-07-05
-------------------
This patch fixes some inconsistency between argument handling for
:obj:`@example <hypothesis.example>` and :func:`@given <hypothesis.given>`
(:issue:`2706 <2706#issuecomment-1168363177>`).
.. _v6.49.0:
-------------------
6.49.0 - 2022-07-04
-------------------
This release uses :pep:`612` :obj:`python:typing.ParamSpec` (or the
:pypi:`typing-extensions` backport) to express the first-argument-removing
behaviour of :func:`@st.composite <hypothesis.strategies.composite>`
and signature-preservation of :func:`~hypothesis.strategies.functions`
to IDEs, editor plugins, and static type checkers such as :pypi:`mypy`.
.. _v6.48.3:
-------------------
6.48.3 - 2022-07-03
-------------------
:func:`hypothesis.event` now works for hashable objects which do not
support weakrefs, such as integers and tuples.
.. _v6.48.2:
-------------------
6.48.2 - 2022-06-29
-------------------
This patch tidies up some internal introspection logic, which will improve
support for positional-only arguments in a future release (:issue:`2706`).
.. _v6.48.1:
-------------------
6.48.1 - 2022-06-27
-------------------
This release automatically rewrites some simple filters, such as
``floats().filter(lambda x: x >= 10)`` to the more efficient
``floats(min_value=10)``, based on the AST of the predicate.
We continue to recommend using the efficient form directly wherever
possible, but this should be useful for e.g. :pypi:`pandera` "``Checks``"
where you already have a simple predicate and translating manually
is really annoying. See :issue:`2701` for details.
.. _v6.48.0:
-------------------
6.48.0 - 2022-06-27
-------------------
This release raises :class:`~unittest.SkipTest` for tests which never executed any
examples, for example because the :obj:`~hypothesis.settings.phases` setting
excluded the :obj:`~hypothesis.Phase.explicit`, :obj:`~hypothesis.Phase.reuse`,
and :obj:`~hypothesis.Phase.generate` phases. This helps to avoid cases where
broken tests appear to pass, because they didn't actually execute (:issue:`3328`).
.. _v6.47.5:
-------------------
6.47.5 - 2022-06-25
-------------------
This patch fixes type annotations that had caused the signature of
:func:`@given <hypothesis.given>` to be partially-unknown to type-checkers for Python
versions before 3.10.
.. _v6.47.4:
-------------------
6.47.4 - 2022-06-23
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` on Python 3.11,
following `python/cpython#93754 <https://github.com/python/cpython/pull/93754/>`__.
.. _v6.47.3:
-------------------
6.47.3 - 2022-06-15
-------------------
This patch makes the :obj:`~hypothesis.HealthCheck.too_slow` health check more
consistent with long :obj:`~hypothesis.settings.deadline` tests (:issue:`3367`)
and fixes an install issue under :pypi:`pipenv` which was introduced in
:ref:`Hypothesis 6.47.2 <v6.47.2>` (:issue:`3374`).
.. _v6.47.2:
-------------------
6.47.2 - 2022-06-12
-------------------
We now use the :pep:`654` `ExceptionGroup <https://docs.python.org/3.11/library/exceptions.html#ExceptionGroup>`__
type - provided by the :pypi:`exceptiongroup` backport on older Pythons -
to ensure that if multiple errors are raised in teardown, they will all propagate.
.. _v6.47.1:
-------------------
6.47.1 - 2022-06-10
-------------------
Our pretty-printer no longer sorts dictionary keys, since iteration order is
stable in Python 3.7+ and this can affect reproducing examples (:issue:`3370`).
This PR was kindly supported by `Ordina Pythoneers
<https://www.ordina.nl/vakgebieden/python/>`__.
.. _v6.47.0:
-------------------
6.47.0 - 2022-06-07
-------------------
The :ref:`Ghostwritter <ghostwriter>` can now write tests for
:obj:`@classmethod <classmethod>` or :obj:`@staticmethod <staticmethod>`
methods, in addition to the existing support for functions and other callables
(:issue:`3318`). Thanks to Cheuk Ting Ho for the patch.
.. _v6.46.11:
--------------------
6.46.11 - 2022-06-02
--------------------
Mention :func:`hypothesis.strategies.timezones`
in the documentation of :func:`hypothesis.strategies.datetimes` for completeness.
Thanks to George Macon for this addition.
.. _v6.46.10:
--------------------
6.46.10 - 2022-06-01
--------------------
This release contains some small improvements to our documentation.
Thanks to Felix Divo for his contribution!
.. _v6.46.9:
-------------------
6.46.9 - 2022-05-25
-------------------
This patch by Adrian Garcia Badaracco adds type annotations
to some private internals (:issue:`3074`).
.. _v6.46.8:
-------------------
6.46.8 - 2022-05-25
-------------------
This patch by Phillip Schanely makes changes to the
:func:`~hypothesis.strategies.floats` strategy when ``min_value`` or ``max_value`` is
present.
Hypothesis will now be capable of generating every representable value in the bounds.
You may notice that hypothesis is more likely to test values near boundaries, and values
that are very close to zero.
These changes also support future integrations with symbolic execution tools and fuzzers
(:issue:`3086`).
.. _v6.46.7:
-------------------
6.46.7 - 2022-05-19
-------------------
This patch updates the type annotations for :func:`~hypothesis.strategies.tuples` and
:func:`~hypothesis.strategies.one_of` so that type-checkers require its arguments to be
positional-only, and so that it no longer fails under pyright-strict mode (see
:issue:`3348`). Additional changes are made to Hypothesis' internals improve pyright
scans.
.. _v6.46.6:
-------------------
6.46.6 - 2022-05-18
-------------------
This patch by Cheuk Ting Ho adds support for :pep:`655` ``Required`` and ``NotRequired`` as attributes of
:class:`~python:typing.TypedDict` in :func:`~hypothesis.strategies.from_type` (:issue:`3339`).
.. _v6.46.5:
-------------------
6.46.5 - 2022-05-15
-------------------
This patch fixes :func:`~hypothesis.extra.numpy.from_dtype` with long-precision
floating-point datatypes (typecode ``g``; see :func:`numpy:numpy.typename`).
.. _v6.46.4:
-------------------
6.46.4 - 2022-05-15
-------------------
This patch improves some error messages for custom signatures
containing invalid parameter names (:issue:`3317`).
.. _v6.46.3:
-------------------
6.46.3 - 2022-05-11
-------------------
This patch by Cheuk Ting Ho makes it an explicit error to call :func:`~hypothesis.strategies.from_type`
or :func:`~hypothesis.strategies.register_type_strategy` with types that have no runtime instances (:issue:`3280`).
.. _v6.46.2:
-------------------
6.46.2 - 2022-05-03
-------------------
This patch fixes silently dropping examples when the :obj:`@example <hypothesis.example>`
decorator is applied to itself (:issue:`3319`). This was always a weird pattern, but now it
works. Thanks to Ray Sogata, Keeri Tramm, and Kevin Khuong for working on this patch!
.. _v6.46.1:
-------------------
6.46.1 - 2022-05-01
-------------------
This patch fixes a rare bug where we could incorrectly treat
:obj:`~python:inspect.Parameter.empty` as a type annotation,
if the callable had an explicitly assigned ``__signature__``.
.. _v6.46.0:
-------------------
6.46.0 - 2022-05-01
-------------------
This release adds an ``allow_nil`` argument to :func:`~hypothesis.strategies.uuids`,
which you can use to... generate the nil UUID. Thanks to Shlok Gandhi for the patch!
.. _v6.45.4:
-------------------
6.45.4 - 2022-05-01
-------------------
This patch fixes some missing imports for certain :ref:`Ghostwritten <ghostwriter>`
tests. Thanks to Mel Seto for fixing :issue:`3316`.
.. _v6.45.3:
-------------------
6.45.3 - 2022-04-30
-------------------
This patch teaches :ref:`the Ghostwriter <ghostwriter>` to recognize
many more common argument names (:issue:`3311`).
.. _v6.45.2:
-------------------
6.45.2 - 2022-04-29
-------------------
This patch fixes :issue:`3314`, where Hypothesis would raise an internal
error from :func:`~hypothesis.provisional.domains` or (only on Windows)
from :func:`~hypothesis.strategies.timezones` in some rare circumstances
where the installation was subtly broken.
Thanks to Munir Abdinur for this contribution.
.. _v6.45.1:
-------------------
6.45.1 - 2022-04-27
-------------------
This release fixes deprecation warnings about ``sre_compile`` and ``sre_parse``
imports and ``importlib.resources`` usage when running Hypothesis on Python 3.11.
Thanks to Florian Bruhin for this contribution.
.. _v6.45.0:
-------------------
6.45.0 - 2022-04-22
-------------------
This release updates :func:`xps.indices` by introducing an ``allow_newaxis``
argument, defaulting to ``False``. If ``allow_newaxis=True``, indices can be
generated that add dimensions to arrays, which is achieved by the indexer
containing ``None``. This change is to support a specification change that
expand dimensions via indexing (`data-apis/array-api#408
<https://github.com/data-apis/array-api/pull/408>`_).
.. _v6.44.0:
-------------------
6.44.0 - 2022-04-21
-------------------
This release adds a ``names`` argument to :func:`~hypothesis.extra.pandas.indexes`
and :func:`~hypothesis.extra.pandas.series`, so that you can create Pandas
objects with specific or varied names.
Contributed by Sam Watts.
.. _v6.43.3:
-------------------
6.43.3 - 2022-04-18
-------------------
This patch updates the type annotations for :func:`@given <hypothesis.given>`
so that type-checkers will warn on mixed positional and keyword arguments,
as well as fixing :issue:`3296`.
.. _v6.43.2:
-------------------
6.43.2 - 2022-04-16
-------------------
Fixed a type annotation for ``pyright --strict`` (:issue:`3287`).
.. _v6.43.1:
-------------------
6.43.1 - 2022-04-13
-------------------
This patch makes it an explicit error to call
:func:`~hypothesis.strategies.register_type_strategy` with a
`Pydantic GenericModel <https://docs.pydantic.dev/latest/concepts/models/#generic-models>`__
and a callable, because ``GenericModel`` isn't actually a generic type at
runtime and so you have to register each of the "parametrized versions"
(actually subclasses!) manually. See :issue:`2940` for more details.
.. _v6.43.0:
-------------------
6.43.0 - 2022-04-12
-------------------
This release makes it an explicit error to apply
:func:`@pytest.fixture <pytest:pytest.fixture>` to a function which has
already been decorated with :func:`@given() <hypothesis.given>`. Previously,
``pytest`` would convert your test to a fixture, and then never run it.
.. _v6.42.3:
-------------------
6.42.3 - 2022-04-10
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` on a :class:`~python:typing.TypedDict`
with complex annotations, defined in a file using ``from __future__ import annotations``.
Thanks to Katelyn Gigante for identifying and fixing this bug!
.. _v6.42.2:
-------------------
6.42.2 - 2022-04-10
-------------------
The Hypothesis pytest plugin was not outputting valid xunit2 nodes when
``--junit-xml`` was specified. This has been broken since Pytest 5.4, which
changed the internal API for adding nodes to the junit report.
This also fixes the issue when using hypothesis with ``--junit-xml`` and
``pytest-xdist`` where the junit xml report would not be xunit2 compatible.
Now, when using with ``pytest-xdist``, the junit report will just omit the
``<properties>`` node.
For more details, see `this pytest issue <https://github.com/pytest-dev/pytest/issues/1126#issuecomment-484581283>`__,
`this pytest issue <https://github.com/pytest-dev/pytest/issues/7767#issuecomment-1082436256>`__,
and :issue:`1935`.
Thanks to Brandon Chinn for this bug fix!
.. _v6.42.1:
-------------------
6.42.1 - 2022-04-10
-------------------
This patch fixes pretty-printing of regular expressions in Python 3.11.0a7, and
updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,.
.. _v6.42.0:
-------------------
6.42.0 - 2022-04-09
-------------------
This release makes :func:`st.functions(pure=True) <hypothesis.strategies.functions>` less noisy (:issue:`3253`),
and generally improves pretty-printing of functions.
.. _v6.41.0:
-------------------
6.41.0 - 2022-04-01
-------------------
This release changes the implementation of :const:`~hypothesis.infer` to be an alias
for :obj:`python:Ellipsis`. E.g. ``@given(a=infer)`` is now equivalent to ``@given(a=...)``. Furthermore, ``@given(...)`` can now be specified so that
:func:`@given <hypothesis.given>` will infer the strategies for *all* arguments of the
decorated function based on its annotations.
.. _v6.40.3:
-------------------
6.40.3 - 2022-04-01
-------------------
This patch simplifies the repr of the strategies namespace returned in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`, e.g.
.. code-block:: pycon
>>> from hypothesis.extra.array_api import make_strategies_namespace
>>> from numpy import array_api as xp
>>> xps = make_strategies_namespace(xp)
>>> xps
make_strategies_namespace(numpy.array_api)
.. _v6.40.2:
-------------------
6.40.2 - 2022-04-01
-------------------
Fixed :func:`~hypothesis.strategies.from_type` support for
:pep:`604` union types, like ``int | None`` (:issue:`3255`).
.. _v6.40.1:
-------------------
6.40.1 - 2022-04-01
-------------------
Fixed an internal error when :func:`~hypothesis.given` was passed a lambda.
.. _v6.40.0:
-------------------
6.40.0 - 2022-03-29
-------------------
:ref:`The Ghostwriter <ghostwriter>` can now write tests which check that
two or more functions are equivalent on valid inputs, *or* raise the same
type of exception for invalid inputs (:issue:`3267`).
.. _v6.39.6:
-------------------
6.39.6 - 2022-03-27
-------------------
This patch makes some quality-of-life improvements to the
:ref:`Ghostwriter <ghostwriter>`: we guess the :func:`~hypothesis.strategies.text`
strategy for arguments named ``text`` (...obvious in hindsight, eh?);
and improved the error message if you accidentally left in a
:func:`~hypothesis.strategies.nothing` or broke your :pypi:`rich` install.
.. _v6.39.5:
-------------------
6.39.5 - 2022-03-26
-------------------
This patch improves our error detection and message when Hypothesis is run
on a Python implementation without support for ``-0.0``, which is required
for the :func:`~hypothesis.strategies.floats` strategy but can be disabled by
`unsafe compiler options <https://simonbyrne.github.io/notes/fastmath/>`__
(:issue:`3265`).
.. _v6.39.4:
-------------------
6.39.4 - 2022-03-17
-------------------
This patch tweaks some internal formatting. There is no user-visible change.
.. _v6.39.3:
-------------------
6.39.3 - 2022-03-07
-------------------
If the :obj:`~hypothesis.Phase.shrink` phase is disabled, we now stop the
:obj:`~hypothesis.Phase.generate` phase as soon as an error is found regardless
of the value of the ``report_multiple_examples`` setting, since that's
probably what you wanted (:issue:`3244`).
.. _v6.39.2:
-------------------
6.39.2 - 2022-03-07
-------------------
This patch clarifies rare error messages in
:func:`~hypothesis.strategies.builds` (:issue:`3225`) and
:func:`~hypothesis.strategies.floats` (:issue:`3207`).
.. _v6.39.1:
-------------------
6.39.1 - 2022-03-03
-------------------
This patch fixes a regression where the bound inner function
(``your_test.hypothesis.inner_test``) would be invoked with positional
arguments rather than passing them by name, which broke
:pypi:`pytest-asyncio` (:issue:`3245`).
.. _v6.39.0:
-------------------
6.39.0 - 2022-03-01
-------------------
This release improves Hypothesis' handling of positional-only arguments,
which are now allowed :func:`@st.composite <hypothesis.strategies.composite>`
strategies.
On Python 3.8 and later, the first arguments to :func:`~hypothesis.strategies.builds`
and :func:`~hypothesis.extra.django.from_model` are now natively positional-only.
In cases which were already errors, the ``TypeError`` from incorrect usage will
therefore be raises immediately when the function is called, rather than when
the strategy object is used.
.. _v6.38.0:
-------------------
6.38.0 - 2022-02-26
-------------------
This release makes :func:`~hypothesis.strategies.floats` error *consistently* when
your floating-point hardware has been configured to violate IEEE-754 for
:wikipedia:`subnormal numbers <Subnormal_number>`, instead of
only when an internal assertion was tripped (:issue:`3092`).
If this happens to you, passing ``allow_subnormal=False`` will suppress the explicit
error. However, we strongly recommend fixing the root cause by disabling global-effect
unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne's
`Beware of fast-math <https://simonbyrne.github.io/notes/fastmath/>`__ explainer first.
.. _v6.37.2:
-------------------
6.37.2 - 2022-02-21
-------------------
This patch fixes a bug in stateful testing, where returning a single value
wrapped in :func:`~hypothesis.stateful.multiple` would be printed such that
the assigned variable was a tuple rather than the single element
(:issue:`3236`).
.. _v6.37.1:
-------------------
6.37.1 - 2022-02-21
-------------------
This patch fixes a warning under :pypi:`pytest` 7 relating to our
rich traceback display logic (:issue:`3223`).
.. _v6.37.0:
-------------------
6.37.0 - 2022-02-18
-------------------
When distinguishing multiple errors, Hypothesis now looks at the inner
exceptions of :pep:`654` ``ExceptionGroup``\ s.
.. _v6.36.2:
-------------------
6.36.2 - 2022-02-13
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.36.1:
-------------------
6.36.1 - 2022-01-31
-------------------
This patch fixes some deprecation warnings from :pypi:`pytest` 7.0,
along with some code formatting and docs updates.
.. _v6.36.0:
-------------------
6.36.0 - 2022-01-19
-------------------
This release disallows using :obj:`python:typing.Final`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.
Why?
Because ``Final`` can only be used during ``class`` definition.
We don't generate class attributes.
It also does not make sense as a runtime type on its own.
.. _v6.35.1:
-------------------
6.35.1 - 2022-01-17
-------------------
This patch fixes ``hypothesis write`` output highlighting with :pypi:`rich`
version 12.0 and later.
.. _v6.35.0:
-------------------
6.35.0 - 2022-01-08
-------------------
This release disallows using :obj:`python:typing.ClassVar`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.
Why?
Because ``ClassVar`` can only be used during ``class`` definition.
We don't generate class attributes.
It also does not make sense as a runtime type on its own.
.. _v6.34.2:
-------------------
6.34.2 - 2022-01-05
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.34.1:
-------------------
6.34.1 - 2021-12-31
-------------------
This patch fixes :issue:`3169`, an extremely rare bug which would
trigger if an internal least-recently-reused cache dropped a newly
added entry immediately after it was added.
.. _v6.34.0:
-------------------
6.34.0 - 2021-12-31
-------------------
This release fixes :issue:`3133` and :issue:`3144`, where attempting
to generate Pandas series of lists or sets would fail with confusing
errors if you did not specify ``dtype=object``.
.. _v6.33.0:
-------------------
6.33.0 - 2021-12-30
-------------------
This release disallows using :obj:`python:typing.TypeAlias`
with :func:`~hypothesis.strategies.from_type`
and :func:`~hypothesis.strategies.register_type_strategy`.
Why? Because ``TypeAlias`` is not really a type,
it is a tag for type checkers that some expression is a type alias,
not something else.
It does not make sense for Hypothesis to resolve it as a strategy.
References :issue:`2978`.
.. _v6.32.1:
-------------------
6.32.1 - 2021-12-23
-------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.32.0:
-------------------
6.32.0 - 2021-12-23
-------------------
This release drops support for Python 3.6, which `reached end of life upstream
<https://devguide.python.org/#status-of-python-branches>`__ on 2021-12-23.
.. _v6.31.6:
-------------------
6.31.6 - 2021-12-15
-------------------
This patch adds a temporary hook for a downstream tool,
which is not part of the public API.
.. _v6.31.5:
-------------------
6.31.5 - 2021-12-14
-------------------
This release updates our copyright headers to `use a general authorship statement and omit the year
<https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/>`__.
.. _v6.31.4:
-------------------
6.31.4 - 2021-12-11
-------------------
This patch makes the ``.example()`` method more representative of
test-time data generation, albeit often at a substantial cost to
readability (:issue:`3182`).
.. _v6.31.3:
-------------------
6.31.3 - 2021-12-10
-------------------
This patch improves annotations on some of Hypothesis' internal functions, in order to
deobfuscate the signatures of some strategies. In particular, strategies shared between
:ref:`hypothesis.extra.numpy <hypothesis-numpy>` and
:ref:`the hypothesis.extra.array_api extra <array-api>` will benefit from this patch.
.. _v6.31.2:
-------------------
6.31.2 - 2021-12-10
-------------------
This patch fix invariants display in stateful falsifying examples (:issue:`3185`).
.. _v6.31.1:
-------------------
6.31.1 - 2021-12-10
-------------------
This patch updates :func:`xps.indices` so no flat indices are generated, i.e.
generated indices will now always explicitly cover each axes of an array if no
ellipsis is present. This is to be consistent with a specification change that
dropped support for flat indexing
(`#272 <https://github.com/data-apis/array-api/pull/272>`_).
.. _v6.31.0:
-------------------
6.31.0 - 2021-12-09
-------------------
This release makes us compatible with :pypi:`Django` 4.0, in particular by adding
support for use of :mod:`zoneinfo` timezones (though we respect the new
``USE_DEPRECATED_PYTZ`` setting if you need it).
.. _v6.30.1:
-------------------
6.30.1 - 2021-12-05
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.30.0:
-------------------
6.30.0 - 2021-12-03
-------------------
This release adds an ``allow_subnormal`` argument to the
:func:`~hypothesis.strategies.floats` strategy, which can explicitly toggle the
generation of :wikipedia:`subnormal floats <Subnormal_number>` (:issue:`3155`).
Disabling such generation is useful when testing flush-to-zero builds of
libraries.
:func:`nps.from_dtype() <hypothesis.extra.numpy.from_dtype>` and
:func:`xps.from_dtype` can also accept the ``allow_subnormal`` argument, and
:func:`xps.from_dtype` or :func:`xps.arrays` will disable subnormals by default
if the array module ``xp`` is detected to flush-to-zero (like is typical with
CuPy).
.. _v6.29.3:
-------------------
6.29.3 - 2021-12-02
-------------------
This patch fixes a bug in :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`,
which restricted the patterns of singleton dimensions that could be generated for
dimensions that extended beyond ``base_shape`` (:issue:`3170`).
.. _v6.29.2:
-------------------
6.29.2 - 2021-12-02
-------------------
This patch clarifies our pretty-printing of DataFrames (:issue:`3114`).
.. _v6.29.1:
-------------------
6.29.1 - 2021-12-02
-------------------
This patch documents :func:`~hypothesis.strategies.timezones`
`Windows-only requirement <https://docs.python.org/3/library/zoneinfo.html#data-sources>`__
for the :pypi:`tzdata` package, and ensures that
``pip install hypothesis[zoneinfo]`` will install the latest version.
.. _v6.29.0:
-------------------
6.29.0 - 2021-11-29
-------------------
This release teaches :func:`~hypothesis.strategies.builds` to use
:func:`~hypothesis.strategies.deferred` when resolving unrecognised type hints,
so that you can conveniently register strategies for recursive types
with constraints on some arguments (:issue:`3026`):
.. code-block:: python
class RecursiveClass:
def __init__(self, value: int, next_node: typing.Optional["SomeClass"]):
assert value > 0
self.value = value
self.next_node = next_node
st.register_type_strategy(
RecursiveClass, st.builds(RecursiveClass, value=st.integers(min_value=1))
)
.. _v6.28.1:
-------------------
6.28.1 - 2021-11-28
-------------------
This release fixes some internal calculations related to collection sizes (:issue:`3143`).
.. _v6.28.0:
-------------------
6.28.0 - 2021-11-28
-------------------
This release modifies our :pypi:`pytest` plugin, to avoid importing Hypothesis
and therefore triggering :ref:`Hypothesis' entry points <entry-points>` for
test suites where Hypothesis is installed but not actually used (:issue:`3140`).
.. _v6.27.3:
-------------------
6.27.3 - 2021-11-28
-------------------
This release fixes :issue:`3080`, where :func:`~hypothesis.strategies.from_type`
failed on unions containing :pep:`585` builtin generic types (like ``list[int]``)
in Python 3.9 and later.
.. _v6.27.2:
-------------------
6.27.2 - 2021-11-26
-------------------
This patch makes the :command:`hypothesis codemod`
:ref:`command <hypothesis-cli>` somewhat faster.
.. _v6.27.1:
-------------------
6.27.1 - 2021-11-22
-------------------
This patch changes the backing datastructures of :func:`~hypothesis.register_random`
and a few internal caches to use :class:`weakref.WeakValueDictionary`. This reduces
memory usage and may improve performance when registered :class:`~random.Random`
instances are only used for a subset of your tests (:issue:`3131`).
.. _v6.27.0:
-------------------
6.27.0 - 2021-11-22
-------------------
This release teaches Hypothesis' multiple-error reporting to format tracebacks
using :pypi:`pytest` or :pypi:`better-exceptions`, if they are installed and
enabled (:issue:`3116`).
.. _v6.26.0:
-------------------
6.26.0 - 2021-11-21
-------------------
Did you know that of the 2\ :superscript:`64` possible floating-point numbers,
2\ :superscript:`53` of them are ``nan`` - and Python prints them all the same way?
While nans *usually* have all zeros in the sign bit and mantissa, this
`isn't always true <https://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations>`__,
and :wikipedia:`'signaling' nans might trap or error <NaN#Signaling_NaN>`.
To help distinguish such errors in e.g. CI logs, Hypothesis now prints ``-nan`` for
negative nans, and adds a comment like ``# Saw 3 signaling NaNs`` if applicable.
.. _v6.25.0:
-------------------
6.25.0 - 2021-11-19
-------------------
This release adds special filtering logic to make a few special cases
like ``s.map(lambda x: x)`` and ``lists().filter(len)`` more efficient
(:issue:`2701`).
.. _v6.24.6:
-------------------
6.24.6 - 2021-11-18
-------------------
This patch makes :func:`~hypothesis.strategies.floats` generate
:wikipedia:`"subnormal" floating point numbers <Subnormal_number>`
more often, as these rare values can have strange interactions with
`unsafe compiler optimisations like -ffast-math
<https://simonbyrne.github.io/notes/fastmath/#flushing_subnormals_to_zero>`__
(:issue:`2976`).
.. _v6.24.5:
-------------------
6.24.5 - 2021-11-16
-------------------
This patch fixes a rare internal error in the :func:`~hypothesis.strategies.datetimes`
strategy, where the implementation of ``allow_imaginary=False`` crashed when checking
a time during the skipped hour of a DST transition *if* the DST offset is negative -
only true of ``Europe/Dublin``, who we presume have their reasons - and the ``tzinfo``
object is a :pypi:`pytz` timezone (which predates :pep:`495`).
.. _v6.24.4:
-------------------
6.24.4 - 2021-11-15
-------------------
This patch gives Hypothesis it's own internal :class:`~random.Random` instance,
ensuring that test suites which reset the global random state don't induce
weird correlations between property-based tests (:issue:`2135`).
.. _v6.24.3:
-------------------
6.24.3 - 2021-11-13
-------------------
This patch updates documentation of :func:`~hypothesis.note`
(:issue:`3147`).
.. _v6.24.2:
-------------------
6.24.2 - 2021-11-05
-------------------
This patch updates internal testing for the :ref:`Array API extra <array-api>`
to be consistent with new specification changes: ``sum()`` not accepting
boolean arrays (`#234 <https://github.com/data-apis/array-api/pull/234>`_),
``unique()`` split into separate functions
(`#275 <https://github.com/data-apis/array-api/pull/275>`_), and treating NaNs
as distinct (`#310 <https://github.com/data-apis/array-api/pull/310>`_). It has
no user visible impact.
.. _v6.24.1:
-------------------
6.24.1 - 2021-11-01
-------------------
This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
.. _v6.24.0:
-------------------
6.24.0 - 2021-10-23
-------------------
This patch updates our vendored `list of top-level domains
<https://data.iana.org/TLD/tlds-alpha-by-domain.txt>`__, which is used
by the provisional :func:`~hypothesis.provisional.domains` strategy.
(did you know that gTLDs can be both `added <https://newgtlds.icann.org/en/>`__
and `removed <https://www.icann.org/resources/pages/gtld-registry-agreement-termination-2015-10-09-en>`__?)
.. _v6.23.4:
-------------------
6.23.4 - 2021-10-20
-------------------
This patch adds an error for when ``shapes`` in :func:`xps.arrays()` is not
passed as either a valid shape or strategy.
.. _v6.23.3:
-------------------
6.23.3 - 2021-10-18
-------------------
This patch updates our formatting with :pypi:`shed`.
.. _v6.23.2:
-------------------
6.23.2 - 2021-10-08
-------------------
This patch replaces external links to :doc:`NumPy <numpy:index>` API docs
with :mod:`sphinx.ext.intersphinx` cross-references. It is purely a documentation improvement.
.. _v6.23.1:
-------------------
6.23.1 - 2021-09-29
-------------------
This patch cleans up internal logic for :func:`xps.arrays()`. There is no
user-visible change.
.. _v6.23.0:
-------------------
6.23.0 - 2021-09-26
-------------------
This release follows :pypi:`pytest` in considering :class:`SystemExit` and
:class:`GeneratorExit` exceptions to be test failures, meaning that we will
shink to minimal examples and check for flakiness even though they subclass
:class:`BaseException` directly (:issue:`2223`).
:class:`KeyboardInterrupt` continues to interrupt everything, and will be
re-raised immediately.
.. _v6.22.0:
-------------------
6.22.0 - 2021-09-24
-------------------
This release adds :class:`~hypothesis.extra.django.LiveServerTestCase` and
:class:`~hypothesis.extra.django.StaticLiveServerTestCase` for django test.
Thanks to Ivan Tham for this feature!
.. _v6.21.6:
-------------------
6.21.6 - 2021-09-19
-------------------
This patch fixes some new linter warnings such as :pypi:`flake8-bugbear`'s
``B904`` for explicit exception chaining, so tracebacks might be a bit nicer.
.. _v6.21.5:
-------------------
6.21.5 - 2021-09-16
-------------------
This release fixes ``None`` being inferred as the float64 dtype in
:func:`~xps.from_dtype()` and :func:`~xps.arrays()` from the
:ref:`Array API extra <array-api>`.
.. _v6.21.4:
-------------------
6.21.4 - 2021-09-16
-------------------
This release fixes the type hint for the
:func:`@given() <hypothesis.given>` decorator
when decorating an ``async`` function (:issue:`3099`).
.. _v6.21.3:
-------------------
6.21.3 - 2021-09-15
-------------------
This release improves Ghostwritten tests for builtins (:issue:`2977`).
.. _v6.21.2:
-------------------
6.21.2 - 2021-09-15
-------------------
This release deprecates use of both ``min_dims > len(shape)`` and
``max_dims > len(shape)`` when ``allow_newaxis == False`` in
:func:`~hypothesis.extra.numpy.basic_indices` (:issue:`3091`).
.. _v6.21.1:
-------------------
6.21.1 - 2021-09-13
-------------------
This release improves the behaviour of :func:`~hypothesis.strategies.builds`
and :func:`~hypothesis.strategies.from_type` in certain situations involving
decorators (:issue:`2495` and :issue:`3029`).
.. _v6.21.0:
-------------------
6.21.0 - 2021-09-11
-------------------
This release introduces strategies for array/tensor libraries adopting the
`Array API standard <https://data-apis.org/>`__ (:issue:`3037`).
They are available in :ref:`the hypothesis.extra.array_api extra <array-api>`,
and work much like the existing :ref:`strategies for NumPy <hypothesis-numpy>`.
.. _v6.20.1:
-------------------
6.20.1 - 2021-09-10
-------------------
This patch fixes :issue:`961`, where calling ``given()`` inline on a
bound method would fail to handle the ``self`` argument correctly.
.. _v6.20.0:
-------------------
6.20.0 - 2021-09-09
-------------------
This release allows :func:`~hypothesis.strategies.slices` to generate ``step=None``,
and fixes an off-by-one error where the ``start`` index could be equal to ``size``.
This works fine for all Python sequences and Numpy arrays, but is undefined behaviour
in the `Array API standard <https://data-apis.org/>`__ (see :pull:`3065`).
.. _v6.19.0:
-------------------
6.19.0 - 2021-09-08
-------------------
This release makes :ref:`stateful testing <stateful>` more likely to tell you
if you do something unexpected and unsupported:
- The :obj:`~hypothesis.HealthCheck.return_value` health check now applies to
:func:`~hypothesis.stateful.rule` and :func:`~hypothesis.stateful.initialize`
rules, if they don't have ``target`` bundles, as well as
:func:`~hypothesis.stateful.invariant`.
- Using a :func:`~hypothesis.stateful.consumes` bundle as a ``target`` is
deprecated, and will be an error in a future version.
If existing code triggers these new checks, check for related bugs and
misunderstandings - these patterns *never* had any effect.
.. _v6.18.0:
-------------------
6.18.0 - 2021-09-06
-------------------
This release teaches :func:`~hypothesis.strategies.from_type` a neat trick:
when resolving an :obj:`python:typing.Annotated` type, if one of the annotations
is a strategy object we use that as the inferred strategy. For example:
.. code-block:: python
PositiveInt = Annotated[int, st.integers(min_value=1)]
If there are multiple strategies, we use the last outer-most annotation.
See :issue:`2978` and :pull:`3082` for discussion.
*Requires Python 3.9 or later for*
:func:`get_type_hints(..., include_extras=False) <typing.get_type_hints>`.
.. _v6.17.4:
-------------------
6.17.4 - 2021-08-31
-------------------
This patch makes unique :func:`~hypothesis.extra.numpy.arrays` much more
efficient, especially when there are only a few valid elements - such as
for eight-bit integers (:issue:`3066`).
.. _v6.17.3:
-------------------
6.17.3 - 2021-08-30
-------------------
This patch fixes the repr of :func:`~hypothesis.extra.numpy.array_shapes`.
.. _v6.17.2:
-------------------
6.17.2 - 2021-08-30
-------------------
This patch wraps some internal helper code in our proxies decorator to prevent
mutations of method docstrings carrying over to other instances of the respective
methods.
.. _v6.17.1:
-------------------
6.17.1 - 2021-08-29
-------------------
This patch moves some internal helper code in preparation for :issue:`3065`.
There is no user-visible change, unless you depended on undocumented internals.
.. _v6.17.0:
-------------------
6.17.0 - 2021-08-27
-------------------
This release adds type annotations to the :ref:`stateful testing <stateful>` API.
Thanks to Ruben Opdebeeck for this contribution!
.. _v6.16.0:
-------------------
6.16.0 - 2021-08-27
-------------------
This release adds the :class:`~hypothesis.strategies.DrawFn` type as a reusable
type hint for the ``draw`` argument of
:func:`@composite <hypothesis.strategies.composite>` functions.
Thanks to Ruben Opdebeeck for this contribution!
.. _v6.15.0:
-------------------
6.15.0 - 2021-08-22
-------------------
This release emits a more useful error message when :func:`@given() <hypothesis.given>`
is applied to a coroutine function, i.e. one defined using ``async def`` (:issue:`3054`).
This was previously only handled by the generic :obj:`~hypothesis.HealthCheck.return_value`
health check, which doesn't direct you to use either :ref:`a custom executor <custom-function-execution>`
or a library such as :pypi:`pytest-trio` or :pypi:`pytest-asyncio` to handle it for you.
.. _v6.14.9:
-------------------
6.14.9 - 2021-08-20
-------------------
This patch fixes a regression in Hypothesis 6.14.8, where :func:`~hypothesis.strategies.from_type`
failed to resolve types which inherit from multiple parametrised generic types,
affecting the :pypi:`returns` package (:issue:`3060`).
.. _v6.14.8:
-------------------
6.14.8 - 2021-08-16
-------------------
This patch ensures that registering a strategy for a subclass of a a parametrised
generic type such as ``class Lines(Sequence[str]):`` will not "leak" into unrelated
strategies such as ``st.from_type(Sequence[int])`` (:issue:`2951`).
Unfortunately this fix requires :pep:`560`, meaning Python 3.7 or later.
.. _v6.14.7:
-------------------
6.14.7 - 2021-08-14
-------------------
This patch fixes :issue:`3050`, where :pypi:`attrs` classes could
cause an internal error in the :ref:`ghostwriter <ghostwriter>`.
.. _v6.14.6:
-------------------
6.14.6 - 2021-08-07
-------------------
This patch improves the error message for :issue:`3016`, where :pep:`585`
builtin generics with self-referential forward-reference strings cannot be
resolved to a strategy by :func:`~hypothesis.strategies.from_type`.
.. _v6.14.5:
-------------------
6.14.5 - 2021-07-27
-------------------
This patch fixes ``hypothesis.strategies._internal.types.is_a_new_type``.
It was failing on Python ``3.10.0b4``, where ``NewType`` is a function.
.. _v6.14.4:
-------------------
6.14.4 - 2021-07-26
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` and
:func:`~hypothesis.strategies.register_type_strategy` for
:obj:`python:typing.NewType` on Python 3.10, which changed the
underlying implementation (see :bpo:`44353` for details).
.. _v6.14.3:
-------------------
6.14.3 - 2021-07-18
-------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.14.2:
-------------------
6.14.2 - 2021-07-12
-------------------
This patch ensures that we shorten tracebacks for tests which fail due
to inconsistent data generation between runs (i.e. raise ``Flaky``).
.. _v6.14.1:
-------------------
6.14.1 - 2021-07-02
-------------------
This patch updates some internal type annotations.
There is no user-visible change.
.. _v6.14.0:
-------------------
6.14.0 - 2021-06-09
-------------------
The |Phase.explain| phase now requires shrinking to be enabled,
and will be automatically skipped for deadline-exceeded errors.
.. _v6.13.14:
--------------------
6.13.14 - 2021-06-04
--------------------
This patch improves the :func:`~hypothesis.strategies.tuples` strategy
type annotations, to preserve the element types for up to length-five
tuples (:issue:`3005`).
As for :func:`~hypothesis.strategies.one_of`, this is the best we can do
before a `planned extension <https://mail.python.org/archives/list/typing-sig@python.org/thread/LOQFV3IIWGFDB7F5BDX746EZJG4VVBI3/>`__
to :pep:`646` is released, hopefully in Python 3.11.
.. _v6.13.13:
--------------------
6.13.13 - 2021-06-04
--------------------
This patch teaches :ref:`the Ghostwriter <ghostwriter>` how to find
:doc:`custom ufuncs <numpy:reference/ufuncs>` from *any* module that defines them,
and that ``yaml.unsafe_load()`` does not undo ``yaml.safe_load()``.
.. _v6.13.12:
--------------------
6.13.12 - 2021-06-03
--------------------
This patch reduces the amount of internal code excluded from our test suite's
code coverage checks.
There is no user-visible change.
.. _v6.13.11:
--------------------
6.13.11 - 2021-06-02
--------------------
This patch removes some old internal helper code that previously existed
to make Python 2 compatibility easier.
There is no user-visible change.
.. _v6.13.10:
--------------------
6.13.10 - 2021-05-30
--------------------
This release adjusts some internal code to help make our test suite more
reliable.
There is no user-visible change.
.. _v6.13.9:
-------------------
6.13.9 - 2021-05-30
-------------------
This patch cleans up some internal code related to filtering strategies.
There is no user-visible change.
.. _v6.13.8:
-------------------
6.13.8 - 2021-05-28
-------------------
This patch slightly improves the performance of some internal code for
generating integers.
.. _v6.13.7:
-------------------
6.13.7 - 2021-05-27
-------------------
This patch fixes a bug in :func:`~hypothesis.strategies.from_regex` that
caused ``from_regex("", fullmatch=True)`` to unintentionally generate non-empty
strings (:issue:`4982`).
The only strings that completely match an empty regex pattern are empty
strings.
.. _v6.13.6:
-------------------
6.13.6 - 2021-05-26
-------------------
This patch fixes a bug that caused :func:`~hypothesis.strategies.integers`
to shrink towards negative values instead of positive values in some cases.
.. _v6.13.5:
-------------------
6.13.5 - 2021-05-24
-------------------
This patch fixes rare cases where ``hypothesis write --binary-op`` could
print :ref:`reproducing instructions <reproducing-inputs>` from the internal
search for an identity element.
.. _v6.13.4:
-------------------
6.13.4 - 2021-05-24
-------------------
This patch removes some unnecessary intermediate list-comprehensions,
using the latest versions of :pypi:`pyupgrade` and :pypi:`shed`.
.. _v6.13.3:
-------------------
6.13.3 - 2021-05-23
-------------------
This patch adds a ``.hypothesis`` property to invalid test functions, bringing
them inline with valid tests and fixing a bug where :pypi:`pytest-asyncio` would
swallow the real error message and mistakenly raise a version incompatibility
error.
.. _v6.13.2:
-------------------
6.13.2 - 2021-05-23
-------------------
Some of Hypothesis's numpy/pandas strategies use a ``fill`` argument to speed
up generating large arrays, by generating a single fill value and sharing that
value among many array slots instead of filling every single slot individually.
When no ``fill`` argument is provided, Hypothesis tries to detect whether it is
OK to automatically use the ``elements`` argument as a fill strategy, so that
it can still use the faster approach.
This patch fixes a bug that would cause that optimization to trigger in some
cases where it isn't 100% guaranteed to be OK.
If this makes some of your numpy/pandas tests run more slowly, try adding an
explicit ``fill`` argument to the relevant strategies to ensure that Hypothesis
always uses the faster approach.
.. _v6.13.1:
-------------------
6.13.1 - 2021-05-20
-------------------
This patch strengthens some internal import-time consistency checks for the
built-in strategies.
There is no user-visible change.
.. _v6.13.0:
-------------------
6.13.0 - 2021-05-18
-------------------
This release adds URL fragment generation to the :func:`~hypothesis.provisional.urls`
strategy (:issue:`2908`). Thanks to Pax (R. Margret) for contributing this patch at the
`PyCon US Mentored Sprints <https://us.pycon.org/2021/summits/mentored-sprints/>`__!
.. _v6.12.1:
-------------------
6.12.1 - 2021-05-17
-------------------
This patch fixes :issue:`2964`, where ``.map()`` and ``.filter()`` methods
were omitted from the ``repr()`` of :func:`~hypothesis.strategies.just` and
:func:`~hypothesis.strategies.sampled_from` strategies, since
:ref:`version 5.43.7 <v5.43.7>`.
.. _v6.12.0:
-------------------
6.12.0 - 2021-05-06
-------------------
This release automatically rewrites some simple filters, such as
``integers().filter(lambda x: x > 9)`` to the more efficient
``integers(min_value=10)``, based on the AST of the predicate.
We continue to recommend using the efficient form directly wherever
possible, but this should be useful for e.g. :pypi:`pandera` "``Checks``"
where you already have a simple predicate and translating manually
is really annoying. See :issue:`2701` for ideas about floats and
simple text strategies.
.. _v6.11.0:
-------------------
6.11.0 - 2021-05-06
-------------------
:func:`hypothesis.target` now returns the ``observation`` value,
allowing it to be conveniently used inline in expressions such as
``assert target(abs(a - b)) < 0.1``.
.. _v6.10.1:
-------------------
6.10.1 - 2021-04-26
-------------------
This patch fixes a deprecation warning if you're using recent versions
of :pypi:`importlib-metadata` (:issue:`2934`), which we use to load
:ref:`third-party plugins <entry-points>` such as `Pydantic's integration
<https://docs.pydantic.dev/latest/hypothesis_plugin/>`__.
On older versions of :pypi:`importlib-metadata`, there is no change and
you don't need to upgrade.
.. _v6.10.0:
-------------------
6.10.0 - 2021-04-17
-------------------
This release teaches the :ref:`Ghostwriter <ghostwriter>` to read parameter
types from Sphinx, Google, or Numpy-style structured docstrings, and improves
some related heuristics about how to test scientific and numerical programs.
.. _v6.9.2:
------------------
6.9.2 - 2021-04-15
------------------
This release improves the :ref:`Ghostwriter's <ghostwriter>` handling
of exceptions, by reading ``:raises ...:`` entries in function docstrings
and ensuring that we don't suppresss the error raised by test assertions.
.. _v6.9.1:
------------------
6.9.1 - 2021-04-12
------------------
This patch updates our autoformatting tools, improving our code style without any API changes.
.. _v6.9.0:
------------------
6.9.0 - 2021-04-11
------------------
This release teaches :func:`~hypothesis.strategies.from_type` how to see
through :obj:`python:typing.Annotated`. Thanks to Vytautas Strimaitis
for reporting and fixing :issue:`2919`!
.. _v6.8.12:
-------------------
6.8.12 - 2021-04-11
-------------------
If :pypi:`rich` is installed, the :command:`hypothesis write` command
will use it to syntax-highlight the :ref:`Ghostwritten <ghostwriter>`
code.
.. _v6.8.11:
-------------------
6.8.11 - 2021-04-11
-------------------
This patch improves an error message from :func:`~hypothesis.strategies.builds`
when :func:`~hypothesis.strategies.from_type` would be more suitable (:issue:`2930`).
.. _v6.8.10:
-------------------
6.8.10 - 2021-04-11
-------------------
This patch updates the type annotations for :func:`~hypothesis.extra.numpy.arrays` to reflect that
``shape: SearchStrategy[int]`` is supported.
.. _v6.8.9:
------------------
6.8.9 - 2021-04-07
------------------
This patch fixes :func:`~hypothesis.strategies.from_type` with
:mod:`abstract types <python:abc>` which have either required but
non-type-annotated arguments to ``__init__``, or where
:func:`~hypothesis.strategies.from_type` can handle some concrete
subclasses but not others.
.. _v6.8.8:
------------------
6.8.8 - 2021-04-07
------------------
This patch teaches :command:`hypothesis write` to check for possible roundtrips
in several more cases, such as by looking for an inverse in the module which
defines the function to test.
.. _v6.8.7:
------------------
6.8.7 - 2021-04-07
------------------
This patch adds a more helpful error message if you try to call
:func:`~hypothesis.strategies.sampled_from` on an :class:`~python:enum.Enum`
which has no members, but *does* have :func:`~python:dataclasses.dataclass`-style
annotations (:issue:`2923`).
.. _v6.8.6:
------------------
6.8.6 - 2021-04-06
------------------
The :func:`~hypothesis.strategies.fixed_dictionaries` strategy now preserves
dict iteration order instead of sorting the keys. This also affects the
pretty-printing of keyword arguments to :func:`@given() <hypothesis.given>`
(:issue:`2913`).
.. _v6.8.5:
------------------
6.8.5 - 2021-04-05
------------------
This patch teaches :command:`hypothesis write` to default to ghostwriting
tests with ``--style=pytest`` only if :pypi:`pytest` is installed, or
``--style=unittest`` otherwise.
.. _v6.8.4:
------------------
6.8.4 - 2021-04-01
------------------
This patch adds type annotations for the :class:`~hypothesis.settings` decorator,
to avoid an error when running mypy in strict mode.
.. _v6.8.3:
------------------
6.8.3 - 2021-03-28
------------------
This patch improves the :ref:`Ghostwriter's <ghostwriter>` handling
of strategies to generate various fiddly types including frozensets,
keysviews, valuesviews, regex matches and patterns, and so on.
.. _v6.8.2:
------------------
6.8.2 - 2021-03-27
------------------
This patch fixes some internal typos. There is no user-visible change.
.. _v6.8.1:
------------------
6.8.1 - 2021-03-14
------------------
This patch lays more groundwork for filter rewriting (:issue:`2701`).
There is no user-visible change... yet.
.. _v6.8.0:
------------------
6.8.0 - 2021-03-11
------------------
This release :func:`registers <hypothesis.strategies.register_type_strategy>` the
remaining builtin types, and teaches :func:`~hypothesis.strategies.from_type` to
try resolving :class:`~python:typing.ForwardRef` and :class:`~python:typing.Type`
references to built-in types.
.. _v6.7.0:
------------------
6.7.0 - 2021-03-10
------------------
This release teaches :class:`~hypothesis.stateful.RuleBasedStateMachine` to avoid
checking :func:`~hypothesis.stateful.invariant`\ s until all
:func:`~hypothesis.stateful.initialize` rules have been run. You can enable checking
of specific invariants for incompletely initialized machines by using
``@invariant(check_during_init=True)`` (:issue:`2868`).
In previous versions, it was possible if awkward to implement this behaviour
using :func:`~hypothesis.stateful.precondition` and an auxiliary variable.
.. _v6.6.1:
------------------
6.6.1 - 2021-03-09
------------------
This patch improves the error message when :func:`~hypothesis.strategies.from_type`
fails to resolve a forward-reference inside a :class:`python:typing.Type`
such as ``Type["int"]`` (:issue:`2565`).
.. _v6.6.0:
------------------
6.6.0 - 2021-03-07
------------------
This release makes it an explicit error to apply :func:`~hypothesis.stateful.invariant`
to a :func:`~hypothesis.stateful.rule` or :func:`~hypothesis.stateful.initialize` rule
in :ref:`stateful testing <stateful>`. Such a combination had unclear semantics,
especially in combination with :func:`~hypothesis.stateful.precondition`, and was never
meant to be allowed (:issue:`2681`).
.. _v6.5.0:
------------------
6.5.0 - 2021-03-07
------------------
This release adds |Phase.explain|, in which Hypothesis
attempts to explain *why* your test failed by pointing to suspicious lines
of code (i.e. those which were always, and only, run on failing inputs).
We plan to include "generalising" failing examples in this phase in a
future release (:issue:`2192`).
.. _v6.4.3:
------------------
6.4.3 - 2021-03-04
------------------
This patch fixes :issue:`2794`, where nesting :func:`~hypothesis.strategies.deferred`
strategies within :func:`~hypothesis.strategies.recursive` strategies could
trigger an internal assertion. While it was always possible to get the same
results from a more sensible strategy, the convoluted form now works too.
.. _v6.4.2:
------------------
6.4.2 - 2021-03-04
------------------
This patch fixes several problems with ``mypy`` when `--no-implicit-reexport <https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport>`_ was activated in user projects.
Thanks to Nikita Sobolev for fixing :issue:`2884`!
.. _v6.4.1:
------------------
6.4.1 - 2021-03-04
------------------
This patch fixes an exception that occurs when using type unions of
the :pypi:`typing-extensions` ``Literal`` backport on Python 3.6.
Thanks to Ben Anhalt for identifying and fixing this bug.
.. _v6.4.0:
------------------
6.4.0 - 2021-03-02
------------------
This release fixes :ref:`stateful testing methods <stateful>` with multiple
:func:`~hypothesis.stateful.precondition` decorators. Previously, only the
outer-most precondition was checked (:issue:`2681`).
.. _v6.3.4:
------------------
6.3.4 - 2021-02-28
------------------
This patch refactors some internals of :class:`~hypothesis.stateful.RuleBasedStateMachine`.
There is no change to the public API or behaviour.
.. _v6.3.3:
------------------
6.3.3 - 2021-02-26
------------------
This patch moves some internal code, so that future work can avoid
creating import cycles. There is no user-visible change.
.. _v6.3.2:
------------------
6.3.2 - 2021-02-25
------------------
This patch enables :func:`~hypothesis.strategies.register_type_strategy` for subclasses of
:class:`python:typing.TypedDict`. Previously, :func:`~hypothesis.strategies.from_type`
would ignore the registered strategy (:issue:`2872`).
Thanks to Ilya Lebedev for identifying and fixing this bug!
.. _v6.3.1:
------------------
6.3.1 - 2021-02-24
------------------
This release lays the groundwork for automatic rewriting of simple filters,
for example converting ``integers().filter(lambda x: x > 9)`` to
``integers(min_value=10)``.
Note that this is **not supported yet**, and we will continue to recommend
writing the efficient form directly wherever possible - predicate rewriting
is provided mainly for the benefit of downstream libraries which would
otherwise have to implement it for themselves (e.g. :pypi:`pandera` and
:pypi:`icontract-hypothesis`). See :issue:`2701` for details.
.. _v6.3.0:
------------------
6.3.0 - 2021-02-20
------------------
The Hypothesis :pypi:`pytest` plugin now requires pytest version 4.6 or later.
If the plugin detects an earlier version of pytest, it will automatically
deactivate itself.
`(4.6.x is the earliest pytest branch that still accepts community bugfixes.)
<https://docs.pytest.org/en/6.2.x/py27-py34-deprecation.html>`__
Hypothesis-based tests should continue to work in earlier versions of
pytest, but enhanced integrations provided by the plugin
(such as ``--hypothesis-show-statistics`` and other command-line flags)
will no longer be available in obsolete pytest versions.
.. _v6.2.0:
------------------
6.2.0 - 2021-02-12
------------------
If you use :pypi:`pytest-html`, Hypothesis now includes the
:ref:`summary statistics for each test <statistics>` in the HTML report,
whether or not the ``--hypothesis-show-statistics`` argument was passed
to show them in the command-line output.
.. _v6.1.1:
------------------
6.1.1 - 2021-01-31
------------------
This patch updates our automatic code formatting to use :pypi:`shed`,
which includes :pypi:`autoflake`, :pypi:`black`, :pypi:`isort`, and
:pypi:`pyupgrade` (:issue:`2780`).
.. _v6.1.0:
------------------
6.1.0 - 2021-01-29
------------------
This release teaches Hypothesis to distinguish between errors based on the
`__cause__ or __context__ of otherwise identical exceptions
<https://docs.python.org/3/library/exceptions.html>`__, which is particularly
useful when internal errors can be wrapped by a library-specific or semantically
appropriate exception such as:
.. code-block:: python
try:
do_the_thing(foo, timeout=10)
except Exception as err:
raise FooError("Failed to do the thing") from err
Earlier versions of Hypothesis only see the ``FooError``, while we can now
distinguish a ``FooError`` raised because of e.g. an internal assertion from
one raised because of a ``TimeoutExceeded`` exception.
.. _v6.0.4:
------------------
6.0.4 - 2021-01-27
------------------
This release prevents a race condition inside :func:`~hypothesis.strategies.recursive` strategies.
The race condition occurs when the same :func:`~hypothesis.strategies.recursive` strategy is shared among tests
that are running in multiple threads (:issue:`2717`).
.. _v6.0.3:
------------------
6.0.3 - 2021-01-23
------------------
This patch improves the type annotations for :func:`~hypothesis.strategies.one_of`,
by adding overloads to handle up to five distinct arguments as
:obj:`~python:typing.Union` before falling back to :obj:`~python:typing.Any`,
as well as annotating the ``|`` (``__or__``) operator for strategies (:issue:`2765`).
.. _v6.0.2:
------------------
6.0.2 - 2021-01-14
------------------
This release makes some small improvements to how filtered strategies work. It should improve the performance of shrinking filtered strategies,
and may under some (probably rare) circumstances improve the diversity of generated examples.
.. _v6.0.1:
------------------
6.0.1 - 2021-01-13
------------------
This patch fixes an interaction where our :ref:`test statistics <statistics>`
handling made Pytest's ``--junit-xml`` output fail to validate against the
strict ``xunit2`` schema (:issue:`1975`).
.. _v6.0.0:
------------------
6.0.0 - 2021-01-08
------------------
Welcome to the next major version of Hypothesis!
There are no new features here, as we release those in minor versions.
Instead, 6.0 is a chance for us to remove deprecated features (many already
converted into no-ops), and turn a variety of warnings into errors.
If you were running on the last version of Hypothesis 5.x *without any
Hypothesis deprecation warnings*, this will be a very boring upgrade.
**In fact, nothing will change for you at all.**
Changes
~~~~~~~
- Many functions now use :pep:`3102` keyword-only arguments where passing positional
arguments :ref:`was deprecated since 5.5 <v5.5.0>`.
- :func:`hypothesis.extra.django.from_model` no longer accepts ``model`` as a
keyword argument, where it could conflict with fields named "model".
- :func:`~hypothesis.strategies.randoms` now defaults to ``use_true_random=False``.
- :func:`~hypothesis.strategies.complex_numbers` no longer accepts
``min_magnitude=None``; either use ``min_magnitude=0`` or just omit the argument.
- ``hypothesis.provisional.ip4_addr_strings`` and ``ip6_addr_strings`` are removed
in favor of :func:`ip_addresses(v=...).map(str) <hypothesis.strategies.ip_addresses>`.
- :func:`~hypothesis.strategies.register_type_strategy` no longer accepts generic
types with type arguments, which were always pretty badly broken.
- Using function-scoped pytest fixtures is now a health-check error, instead of a warning.
.. tip::
The :command:`hypothesis codemod` command can automatically refactor your code,
particularly to convert positional to keyword arguments where those are now
required.
Hypothesis 5.x
==============
.. _v5.49.0:
-------------------
5.49.0 - 2021-01-07
-------------------
This release adds the
:obj:`~hypothesis.HealthCheck.function_scoped_fixture` health check value,
which can be used to suppress the existing warning that appears when
:func:`@given <hypothesis.given>` is applied to a test that uses pytest
function-scoped fixtures.
(This warning exists because function-scoped fixtures only run once per
function, not once per example, which is usually unexpected and can cause
subtle problems.)
When this warning becomes a health check error in a future release, suppressing
it via Python warning settings will no longer be possible.
In the rare case that once-per-function behaviour is intended, it will still be
possible to use :obj:`~hypothesis.HealthCheck.function_scoped_fixture` to
opt out of the health check error for specific tests.
.. _v5.48.0:
-------------------
5.48.0 - 2021-01-06
-------------------
This release adds :func:`hypothesis.currently_in_test_context`, which can be used
to check whether the calling code is currently running inside an
:func:`@given <hypothesis.given>` or :ref:`stateful <stateful>` test.
This is most useful for third-party integrations and assertion helpers which may
wish to use :func:`~hypothesis.assume` or :func:`~hypothesis.target`, without also
requiring that the helper only be used from property-based tests (:issue:`2581`).
.. _v5.47.0:
-------------------
5.47.0 - 2021-01-05
-------------------
This release upgrades the import logic for :ref:`ghostwritten tests <ghostwriter>`,
handling many cases where imports would previously be missing or from unexpected
locations.
.. _v5.46.0:
-------------------
5.46.0 - 2021-01-04
-------------------
This release upgrades :func:`~hypothesis.strategies.from_type`, to infer
strategies for type-annotated arguments even if they have defaults when
it otherwise falls back to :func:`~hypothesis.strategies.builds`
(:issue:`2708`).
.. _v5.45.0:
-------------------
5.45.0 - 2021-01-04
-------------------
This release adds the :ref:`codemods` extra, which you can use to
check for and automatically fix issues such as use of deprecated
Hypothesis APIs (:issue:`2705`).
.. _v5.44.0:
-------------------
5.44.0 - 2021-01-03
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` with
the :pypi:`typing-extensions` ``Literal`` backport on Python 3.6.
.. _v5.43.9:
-------------------
5.43.9 - 2021-01-02
-------------------
This patch fixes :issue:`2722`, where certain orderings of
:func:`~hypothesis.strategies.register_type_strategy`,
:class:`~python:typing.ForwardRef`, and :func:`~hypothesis.strategies.from_type`
could trigger an internal error.
.. _v5.43.8:
-------------------
5.43.8 - 2021-01-02
-------------------
This patch makes some strategies for collections with a uniqueness constraint
much more efficient, including ``dictionaries(keys=sampled_from(...), values=..)``
and ``lists(tuples(sampled_from(...), ...), unique_by=lambda x: x[0])``.
(related to :issue:`2036`)
.. _v5.43.7:
-------------------
5.43.7 - 2021-01-02
-------------------
This patch extends our faster special case for
:func:`~hypothesis.strategies.sampled_from` elements in unique
:func:`~hypothesis.strategies.lists` to account for chains of
``.map(...)`` and ``.filter(...)`` calls (:issue:`2036`).
.. _v5.43.6:
-------------------
5.43.6 - 2021-01-02
-------------------
This patch improves the type annotations on :func:`~hypothesis.assume`
and :func:`@reproduce_failure() <hypothesis.reproduce_failure>`.
.. _v5.43.5:
-------------------
5.43.5 - 2021-01-01
-------------------
This patch updates our copyright headers to include 2021. Happy new year!
.. _v5.43.4:
-------------------
5.43.4 - 2020-12-24
-------------------
This change fixes a documentation error in the
:obj:`~hypothesis.settings.database` setting.
The previous documentation suggested that callers could specify a database
path string, or the special string ``":memory:"``, but this setting has
never actually allowed string arguments.
Permitted values are ``None``, and instances of
:class:`~hypothesis.database.ExampleDatabase`.
.. _v5.43.3:
-------------------
5.43.3 - 2020-12-11
-------------------
This patch fixes :issue:`2696`, an internal error triggered when the
:obj:`@example <hypothesis.example>` decorator was used and the
:obj:`~hypothesis.settings.verbosity` setting was ``quiet``.
.. _v5.43.2:
-------------------
5.43.2 - 2020-12-10
-------------------
This patch improves the error message from the
:func:`~hypothesis.extra.pandas.data_frames` strategy when both the ``rows``
and ``columns`` arguments are given, but there is a missing entry in ``rows``
and the corresponding column has no ``fill`` value (:issue:`2678`).
.. _v5.43.1:
-------------------
5.43.1 - 2020-12-10
-------------------
This patch improves the error message if :func:`~hypothesis.strategies.builds`
is passed an :class:`~python:enum.Enum` which cannot be called without arguments,
to suggest using :func:`~hypothesis.strategies.sampled_from` (:issue:`2693`).
.. _v5.43.0:
-------------------
5.43.0 - 2020-12-09
-------------------
This release adds new :func:`~hypothesis.strategies.timezones` and
:func:`~hypothesis.strategies.timezone_keys` strategies (:issue:`2630`)
based on the new :mod:`python:zoneinfo` module in Python 3.9.
``pip install hypothesis[zoneinfo]`` will ensure that you have the
appropriate backports installed if you need them.
.. _v5.42.3:
-------------------
5.42.3 - 2020-12-09
-------------------
This patch fixes an internal error in :func:`~hypothesis.strategies.datetimes`
with ``allow_imaginary=False`` where the ``timezones`` argument can generate
``tzinfo=None`` (:issue:`2662`).
.. _v5.42.2:
-------------------
5.42.2 - 2020-12-09
-------------------
This patch teaches :func:`hypothesis.extra.django.from_field` to infer
more efficient strategies by inspecting (not just filtering by) field
validators for numeric and string fields (:issue:`1116`).
.. _v5.42.1:
-------------------
5.42.1 - 2020-12-09
-------------------
This patch refactors :class:`hypothesis.settings` to use type-annotated
keyword arguments instead of ``**kwargs``, which makes tab-completion
much more useful - as well as type-checkers like :pypi:`mypy`.
.. _v5.42.0:
-------------------
5.42.0 - 2020-12-09
-------------------
This patch teaches the :func:`~hypothesis.extra.ghostwriter.magic` ghostwriter
to recognise "en/de" function roundtrips other than the common encode/decode
pattern, such as encrypt/decrypt or, encipher/decipher.
.. _v5.41.5:
-------------------
5.41.5 - 2020-12-05
-------------------
This patch adds a performance optimisation to avoid saving redundant
seeds when using :ref:`the .fuzz_one_input hook <fuzz_one_input>`.
.. _v5.41.4:
-------------------
5.41.4 - 2020-11-28
-------------------
This patch fixes :issue:`2657`, where passing unicode patterns compiled with
:obj:`python:re.IGNORECASE` to :func:`~hypothesis.strategies.from_regex` could
trigger an internal error when casefolding a character creates a longer string
(e.g. ``"\u0130".lower() -> "i\u0370"``).
.. _v5.41.3:
-------------------
5.41.3 - 2020-11-18
-------------------
This patch adds a final fallback clause to :ref:`our plugin logic <entry-points>`
to fail with a warning rather than error on Python < 3.8 when neither the
:pypi:`importlib-metadata` (preferred) or :pypi:`setuptools` (fallback)
packages are available.
.. _v5.41.2:
-------------------
5.41.2 - 2020-11-08
-------------------
This patch fixes :func:`~hypothesis.provisional.urls` strategy ensuring that
``~`` (tilde) is treated as one of the url-safe characters (:issue:`2658`).
.. _v5.41.1:
-------------------
5.41.1 - 2020-11-03
-------------------
This patch improves our :ref:`CLI help and documentation <hypothesis-cli>`.
.. _v5.41.0:
-------------------
5.41.0 - 2020-10-30
-------------------
Hypothesis now shrinks examples where the error is raised while drawing from
a strategy. This makes complicated custom strategies *much* easier to debug,
at the cost of a slowdown for use-cases where you catch and ignore such errors.
.. _v5.40.0:
-------------------
5.40.0 - 2020-10-30
-------------------
This release teaches :func:`~hypothesis.strategies.from_type` how to handle
:class:`~python:typing.ChainMap`, :class:`~python:typing.Counter`,
:class:`~python:typing.Deque`, :class:`~python:typing.Generator`,
:class:`~python:typing.Match`, :class:`~python:typing.OrderedDict`,
:class:`~python:typing.Pattern`, and :class:`~python:collections.abc.Set`
(:issue:`2654`).
.. _v5.39.0:
-------------------
5.39.0 - 2020-10-30
-------------------
:func:`~hypothesis.strategies.from_type` now knows how to resolve :pep:`585`
parameterized standard collection types, which are new in Python 3.9
(:issue:`2629`).
.. _v5.38.1:
-------------------
5.38.1 - 2020-10-26
-------------------
This patch fixes :func:`~hypothesis.strategies.builds`, so that when passed
:obj:`~hypothesis.infer` for an argument with a non-:obj:`~python:typing.Optional`
type annotation and a default value of ``None`` to build a class which defines
an explicit ``__signature__`` attribute, either ``None`` or that type may be
generated.
This is unlikely to happen unless you are using :pypi:`pydantic` (:issue:`2648`).
.. _v5.38.0:
-------------------
5.38.0 - 2020-10-24
-------------------
This release improves our support for :func:`@st.composite <hypothesis.strategies.composite>`
on a :obj:`python:classmethod` or :obj:`python:staticmethod` (:issue:`2578`).
.. _v5.37.5:
-------------------
5.37.5 - 2020-10-24
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` with
:class:`Iterable[T] <python:typing.Iterable>` (:issue:`2645`).
.. _v5.37.4:
-------------------
5.37.4 - 2020-10-20
-------------------
This patch teaches the :func:`~hypothesis.extra.ghostwriter.magic` ghostwriter
to recognise that pairs of functions like :func:`~python:colorsys.rgb_to_hsv`
and :func:`~python:colorsys.hsv_to_rgb` should
:func:`~hypothesis.extra.ghostwriter.roundtrip`.
.. _v5.37.3:
-------------------
5.37.3 - 2020-10-15
-------------------
This patch improves :func:`~hypothesis.strategies.builds` and
:func:`~hypothesis.strategies.from_type` support for explicitly defined ``__signature__``
attributes, from :ref:`version 5.8.3 <v5.8.3>`, to support generic types from the
:mod:`python:typing` module.
Thanks to Rónán Carrigan for identifying and fixing this problem!
.. _v5.37.2:
-------------------
5.37.2 - 2020-10-14
-------------------
This patch fixes :func:`~hypothesis.extra.lark.from_lark` with version
0.10.1+ of the :pypi:`lark-parser` package.
.. _v5.37.1:
-------------------
5.37.1 - 2020-10-07
-------------------
This patch fixes some broken links in the :mod:`~hypothesis.extra.lark`
extra documentation.
.. _v5.37.0:
-------------------
5.37.0 - 2020-10-03
-------------------
This release adds a new :class:`~hypothesis.extra.redis.RedisExampleDatabase`,
along with the :class:`~hypothesis.database.ReadOnlyDatabase`
and :class:`~hypothesis.database.MultiplexedDatabase` helpers, to support
team workflows where failing examples can be seamlessly shared between everyone
on the team - and your CI servers or buildbots.
.. _v5.36.2:
-------------------
5.36.2 - 2020-10-02
-------------------
This patch ensures that if the :ref:`"hypothesis" entry point <entry-points>`
is callable, we call it after importing it. You can still use non-callable
entry points (like modules), which are only imported.
We also prefer `importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`__
or :pypi:`the backport <importlib-metadata>` over `pkg_resources
<https://setuptools.pypa.io/en/latest/pkg_resources.html>`__,
which makes ``import hypothesis`` around 200 milliseconds faster
(:issue:`2571`).
.. _v5.36.1:
-------------------
5.36.1 - 2020-09-25
-------------------
This patch adds some helpful suggestions to error messages you might see
while learning to use the :obj:`@example() <hypothesis.example>` decorator
(:issue:`2611`) or the :func:`~hypothesis.strategies.one_of` strategy.
.. _v5.36.0:
-------------------
5.36.0 - 2020-09-24
-------------------
This release upgrades the :func:`~hypothesis.extra.numpy.from_dtype` strategy
to pass optional ``**kwargs`` to the inferred strategy, and upgrades the
:func:`~hypothesis.extra.numpy.arrays` strategy to accept an ``elements=kwargs``
dict to pass through to :func:`~hypothesis.extra.numpy.from_dtype`.
``arrays(floating_dtypes(), shape, elements={"min_value": -10, "max_value": 10})``
is a particularly useful pattern, as it allows for any floating dtype without
triggering the roundoff warning for smaller types or sacrificing variety for
larger types (:issue:`2552`).
.. _v5.35.4:
-------------------
5.35.4 - 2020-09-21
-------------------
This patch reformats our code with the latest :pypi:`black` to
take advantage of the support for magic trailing commas.
.. _v5.35.3:
-------------------
5.35.3 - 2020-09-15
-------------------
This release significantly improves the performance of Hypothesis's internal
implementation of automaton learning. However this code does not run as part
of the user-accessible API so this has no user-visible impact.
.. _v5.35.2:
-------------------
5.35.2 - 2020-09-14
-------------------
This patch ensures that, when the ``generate`` :obj:`~hypothesis.settings.phases`
is disabled, we can replay up to :obj:`~hypothesis.settings.max_examples` examples
from the database - which is very useful when
:ref:`using Hypothesis with a fuzzer <fuzz_one_input>`.
Thanks to Afrida Tabassum for fixing :issue:`2585`!
.. _v5.35.1:
-------------------
5.35.1 - 2020-09-14
-------------------
This patch changes some internal :obj:`python:struct.Struct.format` strings
from ``bytes`` to ``str``, to avoid :class:`python:BytesWarning` when running
`python -bb <https://docs.python.org/3/using/cmdline.html#cmdoption-b>`__.
Thanks to everyone involved in `pytest-xdist issue 596
<https://github.com/pytest-dev/pytest-xdist/issues/596>`__,
:bpo:`16349`, :bpo:`21071`, and :bpo:`41777` for their work on this -
it was a remarkably subtle issue!
.. _v5.35.0:
-------------------
5.35.0 - 2020-09-11
-------------------
The :func:`~hypothesis.target` function now accepts integers as well as floats.
.. _v5.34.1:
-------------------
5.34.1 - 2020-09-11
-------------------
This patch adds explicit :obj:`~python:typing.Optional` annotations to our public API,
to better support users who run :pypi:`mypy` with ``--strict`` or ``no_implicit_optional=True``.
Thanks to Krzysztof Przybyła for bringing this to our attention and writing the patch!
.. _v5.34.0:
-------------------
5.34.0 - 2020-09-11
-------------------
This release drops support for Python 3.5, which `reached end of life upstream
<https://devguide.python.org/#status-of-python-branches>`__ on 2020-09-13.
.. _v5.33.2:
-------------------
5.33.2 - 2020-09-09
-------------------
This patch fixes a problem with :func:`~hypothesis.strategies.builds` that was not able to
generate valid data for annotated classes with constructors.
Thanks to Nikita Sobolev for fixing :issue:`2603`!
.. _v5.33.1:
-------------------
5.33.1 - 2020-09-07
-------------------
This patch improves the error message from the :command:`hypothesis write`
command if :pypi:`black` (required for the :ref:`ghostwriter <ghostwriter>`)
is not installed.
Thanks to Nikita Sobolev for fixing :issue:`2604`!
.. _v5.33.0:
-------------------
5.33.0 - 2020-09-06
-------------------
When reporting failing examples, or tried examples in verbose mode, Hypothesis now
identifies which were from :obj:`@example(...) <hypothesis.example>` explicit examples.
.. _v5.32.1:
-------------------
5.32.1 - 2020-09-06
-------------------
This patch contains some internal refactoring.
Thanks to Felix Sheldon for fixing :issue:`2516`!
.. _v5.32.0:
-------------------
5.32.0 - 2020-09-04
-------------------
An array drawn from :func:`~hypothesis.extra.numpy.arrays` will own its own memory; previously most arrays returned by
this strategy were views.
.. _v5.31.0:
-------------------
5.31.0 - 2020-09-04
-------------------
:func:`~hypothesis.strategies.builds` will use the ``__signature__`` attribute of
the target, if it exists, to retrieve type hints.
Previously :func:`python:typing.get_type_hints`, was used by default.
If argument names varied between the ``__annotations__`` and ``__signature__``,
they would not be supplied to the target.
This was particularly an issue for :pypi:`pydantic` models which use an
`alias generator <https://docs.pydantic.dev/latest/api/config/#pydantic.alias_generators>`__.
.. _v5.30.1:
-------------------
5.30.1 - 2020-09-04
-------------------
This patch makes the :ref:`ghostwriter <ghostwriter>` much more robust when
passed unusual modules.
- improved support for non-resolvable type annotations
- :func:`~hypothesis.extra.ghostwriter.magic` can now write
:func:`~hypothesis.extra.ghostwriter.equivalent` tests
- running :func:`~hypothesis.extra.ghostwriter.magic` on modules where some
names in ``__all__`` are undefined skips such names, instead of raising an error
- :func:`~hypothesis.extra.ghostwriter.magic` now knows to skip mocks
- improved handling of import-time errors found by the ghostwriter CLI
.. _v5.30.0:
-------------------
5.30.0 - 2020-08-30
-------------------
:func:`~hypothesis.strategies.register_type_strategy` now supports
:class:`python:typing.TypeVar`, which was previously hard-coded, and allows a
variety of types to be generated for an unconstrained :class:`~python:typing.TypeVar`
instead of just :func:`~hypothesis.strategies.text`.
Thanks again to Nikita Sobolev for all your work on advanced types!
.. _v5.29.4:
-------------------
5.29.4 - 2020-08-28
-------------------
This release fixes some hard to trigger bugs in Hypothesis's automata learning
code. This code is only run as part of the Hypothesis build process, and not
for user code, so this release has no user visible impact.
.. _v5.29.3:
-------------------
5.29.3 - 2020-08-27
-------------------
This patch adds type annotations to the :ref:`hypothesis.database <database>`
module. There is no runtime change, but your typechecker might notice.
.. _v5.29.2:
-------------------
5.29.2 - 2020-08-27
-------------------
This patch tracks some additional information in Hypothesis internals,
and has no user-visible impact.
.. _v5.29.1:
-------------------
5.29.1 - 2020-08-27
-------------------
This release fixes a bug in some Hypothesis internal support code for learning
automata. This mostly doesn't have any user visible impact, although it slightly
affects the learned shrink passes so shrinking may be subtly different.
.. _v5.29.0:
-------------------
5.29.0 - 2020-08-24
-------------------
This release adds support for :ref:`entry-points`, which allows for smoother
integration of third-party Hypothesis extensions and external libraries.
Unless you're publishing a library with Hypothesis integration, you'll
probably only ever use this indirectly!
.. _v5.28.0:
-------------------
5.28.0 - 2020-08-24
-------------------
:func:`~hypothesis.strategies.from_type` can now resolve :class:`~python:typing.TypeVar`
instances when the ``bound`` is a :class:`~python:typing.ForwardRef`, so long as that name
is in fact defined in the same module as the typevar (no ``TYPE_CHECKING`` tricks, sorry).
This feature requires Python 3.7 or later.
Thanks to Zac Hatfield-Dodds and Nikita Sobolev for this feature!
.. _v5.27.0:
-------------------
5.27.0 - 2020-08-20
-------------------
This patch adds two new :ref:`ghostwriters <ghostwriter>` to test
:wikipedia:`binary operations <Binary_operation>`, like :func:`python:operator.add`,
and Numpy :doc:`ufuncs <numpy:reference/ufuncs>` and :doc:`gufuncs
<numpy:reference/c-api/generalized-ufuncs>` like :data:`np.matmul() <numpy:numpy.matmul>`.
.. _v5.26.1:
-------------------
5.26.1 - 2020-08-19
-------------------
This release improves the performance of some methods in Hypothesis's internal
automaton library. These are currently only lightly used by user code, but
this may result in slightly faster shrinking.
.. _v5.26.0:
-------------------
5.26.0 - 2020-08-17
-------------------
:func:`~hypothesis.strategies.register_type_strategy` no longer accepts
parametrised user-defined generic types, because the resolution logic
was quite badly broken (:issue:`2537`).
Instead of registering a strategy for e.g. ``MyCollection[int]``, you
should register a *function* for ``MyCollection`` and `inspect the type
parameters within that function <https://stackoverflow.com/q/48572831>`__.
Thanks to Nikita Sobolev for the bug report, design assistance, and
pull request to implement this feature!
.. _v5.25.0:
-------------------
5.25.0 - 2020-08-16
-------------------
Tired of writing tests? Or new to Hypothesis and not sure where to start?
This release is for you! With our new :ref:`Ghostwriter functions <ghostwriter>`
and :command:`hypothesis write ...` :ref:`command-line interface <hypothesis-cli>`,
you can stop writing tests entirely... or take the source code Hypothesis
writes for you as a starting point.
This has been in the works for months, from :issue:`2118` to versions
:ref:`5.18.3 <v5.18.3>`, :ref:`5.23.5 <v5.23.5>`, and :ref:`5.23.5 <v5.23.5>` -
particular thanks to the many people who reviewed pull requests or commented on
demos, and to Timothy Crosley's :pypi:`hypothesis-auto` project for inspiration.
.. _v5.24.4:
-------------------
5.24.4 - 2020-08-14
-------------------
This patch adds yet more internal functions to support a new feature
we're working on, like :ref:`version 5.18.3 <v5.18.3>` and
:ref:`version 5.23.6 <v5.23.6>`. We promise it's worth the wait!
.. _v5.24.3:
-------------------
5.24.3 - 2020-08-13
-------------------
This release fixes a small internal bug in Hypothesis's internal automaton library.
Fortunately this bug was currently impossible to hit in user facing code, so this
has no user visible impact.
.. _v5.24.2:
-------------------
5.24.2 - 2020-08-12
-------------------
This release improves shrink quality by allowing Hypothesis to automatically learn new shrink passes
for difficult to shrink tests.
The automatic learning is not currently accessible in user code (it still needs significant work
on robustness and performance before it is ready for that), but this release includes learned
passes that should improve shrinking quality for tests which use any of the
:func:`~hypothesis.strategies.text`, :func:`~hypothesis.strategies.floats`,
:func:`~hypothesis.strategies.datetimes`, :func:`~hypothesis.strategies.emails`,
and :func:`~hypothesis.strategies.complex_numbers` strategies.
.. _v5.24.1:
-------------------
5.24.1 - 2020-08-12
-------------------
This patch updates some docstrings, without changing runtime behaviour.
.. _v5.24.0:
-------------------
5.24.0 - 2020-08-10
-------------------
The :func:`~hypothesis.strategies.functions` strategy has a new argument
``pure=True``, which ensures that the same return value is generated for
identical calls to the generated function (:issue:`2538`).
Thanks to Zac Hatfield-Dodds and Nikita Sobolev for this feature!
.. _v5.23.12:
--------------------
5.23.12 - 2020-08-10
--------------------
This release removes a number of Hypothesis's internal "shrink passes" - transformations
it makes to a generated test case during shrinking - which appeared to be redundant with
other transformations.
It is unlikely that you will see much impact from this. If you do, it will likely show up
as a change in shrinking performance (probably slower, maybe faster), or possibly in
worse shrunk results. If you encounter the latter, please let us know.
.. _v5.23.11:
--------------------
5.23.11 - 2020-08-04
--------------------
This release fixes a bug in some internal Hypothesis support code. It has no user visible impact.
.. _v5.23.10:
--------------------
5.23.10 - 2020-08-04
--------------------
This release improves the quality of shrunk test cases in some special cases.
Specifically, it should get shrinking unstuck in some scenarios which require
simultaneously changing two parts of the generated test case.
.. _v5.23.9:
-------------------
5.23.9 - 2020-08-03
-------------------
This release improves the performance of some internal support code. It has no user visible impact,
as that code is not currently run during normal Hypothesis operation.
.. _v5.23.8:
-------------------
5.23.8 - 2020-07-31
-------------------
This release adds a heuristic to detect when shrinking has finished despite the fact
that there are many more possible transformations to try. This will be particularly
useful for tests where the minimum failing test case is very large despite there being
many smaller test cases possible, where it is likely to speed up shrinking dramatically.
In some cases it is likely that this will result in worse shrunk test cases. In those
cases rerunning the test will result in further shrinking.
.. _v5.23.7:
-------------------
5.23.7 - 2020-07-29
-------------------
This release makes some performance improvements to shrinking. They should
only be noticeable for tests that are currently particularly slow to shrink.
.. _v5.23.6:
-------------------
5.23.6 - 2020-07-29
-------------------
This patch adds some more internal functions to support a new
feature we're working on, like :ref:`version 5.18.3 <v5.18.3>`.
There is still no user-visible change... yet.
.. _v5.23.5:
-------------------
5.23.5 - 2020-07-29
-------------------
This release makes some changes to internal support code that is not currently used in production Hypothesis.
It has no user visible effect at present.
.. _v5.23.4:
-------------------
5.23.4 - 2020-07-29
-------------------
This release improves shrinking quality in some special cases.
.. _v5.23.3:
-------------------
5.23.3 - 2020-07-27
-------------------
This release fixes :issue:`2507`, where lazy evaluation meant that the
values drawn from a :func:`~hypothesis.strategies.sampled_from` strategy
could depend on mutations of the sampled sequence that happened after
the strategy was constructed.
.. _v5.23.2:
-------------------
5.23.2 - 2020-07-27
-------------------
This patch fixes :issue:`2462`, a bug in our handling of :meth:`unittest.TestCase.subTest`.
Thanks to Israel Fruchter for fixing this at the EuroPython sprints!
.. _v5.23.1:
-------------------
5.23.1 - 2020-07-26
-------------------
This release improves the behaviour of the :func:`~hypothesis.strategies.characters` strategy
when shrinking, by changing which characters are considered smallest to prefer more "normal" ascii characters
where available.
.. _v5.23.0:
-------------------
5.23.0 - 2020-07-26
-------------------
The default ``print_blob`` setting is now smarter. It defaults to ``True`` in CI and
``False`` for local development.
Thanks to Hugo van Kemenade for implementing this feature at the EuroPython sprints!
.. _v5.22.0:
-------------------
5.22.0 - 2020-07-25
-------------------
The :func:`~hypothesis.strategies.slices` strategy can now generate slices for empty sequences,
slices with negative start and stop indices (from the end of the sequence),
and ``step=None`` in place of ``step=1``.
Thanks to Sangarshanan for implementing this feature at the EuroPython sprints!
.. _v5.21.0:
-------------------
5.21.0 - 2020-07-23
-------------------
This release ensures that tests which raise ``RecursionError`` are not
reported as flaky simply because we run them from different initial
stack depths (:issue:`2494`).
.. _v5.20.4:
-------------------
5.20.4 - 2020-07-23
-------------------
This release improves the performance of the ``sample`` method on objects obtained from :func:`~hypothesis.strategies.randoms`
when ``use_true_random=False``. This should mostly only be noticeable when the sample size is a large fraction of the population size,
but may also help avoid health check failures in some other cases.
.. _v5.20.3:
-------------------
5.20.3 - 2020-07-21
-------------------
This release makes some internal changes for testing purposes and should have no user visible effect.
.. _v5.20.2:
-------------------
5.20.2 - 2020-07-18
-------------------
This release fixes a small caching bug in Hypothesis internals that may under
some circumstances have resulted in a less diverse set of test cases being
generated than was intended.
Fixing this problem revealed some performance problems that could occur during targeted property based testing, so this release also fixes those. Targeted property-based testing should now be significantly faster in some cases,
but this may be at the cost of reduced effectiveness.
.. _v5.20.1:
-------------------
5.20.1 - 2020-07-17
-------------------
This patch updates our formatting to use :pypi:`isort` 5.
There is no user-visible change.
.. _v5.20.0:
-------------------
5.20.0 - 2020-07-17
-------------------
The :func:`~hypothesis.extra.numpy.basic_indices` strategy can now generate
bare indexers in place of length-one tuples. Thanks to Andrea for this patch!
.. _v5.19.3:
-------------------
5.19.3 - 2020-07-15
-------------------
This patch removes an internal use of ``distutils`` in order to avoid
`this setuptools warning <https://github.com/pypa/setuptools/issues/2261>`__
for some users.
.. _v5.19.2:
-------------------
5.19.2 - 2020-07-13
-------------------
This patch contains a small internal refactoring with no user-visible impact.
Thanks to Andrea for writing this at
`the SciPy 2020 Sprints <https://www.scipy2020.scipy.org/sprints-schedule>`__!
.. _v5.19.1:
-------------------
5.19.1 - 2020-07-12
-------------------
This release slightly improves shrinking behaviour. This should mainly only
impact stateful tests, but may have some minor positive impact on shrinking
collections (lists, sets, etc).
.. _v5.19.0:
-------------------
5.19.0 - 2020-06-30
-------------------
This release improves the :func:`~hypothesis.strategies.randoms` strategy by adding support
for ``Random`` instances where Hypothesis generates the random values
rather than having them be "truly" random.
.. _v5.18.3:
-------------------
5.18.3 - 2020-06-27
-------------------
This patch adds some internal functions to support a new feature
we're working on. There is no user-visible change... yet.
.. _v5.18.2:
-------------------
5.18.2 - 2020-06-26
-------------------
This patch improves our docs for the :obj:`~hypothesis.settings.derandomize` setting.
.. _v5.18.1:
-------------------
5.18.1 - 2020-06-25
-------------------
This release consists of some internal refactoring to the shrinker in preparation for future work. It has no user visible impact.
.. _v5.18.0:
-------------------
5.18.0 - 2020-06-22
-------------------
This release teaches Hypothesis to :ref:`shorten tracebacks <v3.79.2>` for |@example|, as we already do
for generated examples, so that you can focus on your code rather than ours.
If you have multiple failing explicit examples, they will now all be reported.
To report only the first failure, you can use the :obj:`report_multiple_bugs=False
<hypothesis.settings.report_multiple_bugs>` setting as for generated examples.
.. _v5.17.0:
-------------------
5.17.0 - 2020-06-22
-------------------
This patch adds strategy inference for the ``Literal``, ``NewType``, ``Type``,
``DefaultDict``, and ``TypedDict`` types from the :pypi:`typing-extensions`
backport on PyPI.
.. _v5.16.3:
-------------------
5.16.3 - 2020-06-21
-------------------
This patch precomputes some of the setup logic for our
:ref:`external fuzzer integration <fuzz_one_input>` and sets
:obj:`deadline=None <hypothesis.settings.deadline>` in fuzzing mode,
saving around 150us on each iteration.
This is around two-thirds the runtime to fuzz an empty test with
``@given(st.none())``, and nice to have even as a much smaller
fraction of the runtime for non-trivial tests.
.. _v5.16.2:
-------------------
5.16.2 - 2020-06-19
-------------------
This patch fixes an internal error when warning about the use of function-scoped fixtures
for parametrised tests where the parametrised value contained a ``%`` character.
Thanks to Bryant for reporting and fixing this bug!
.. _v5.16.1:
-------------------
5.16.1 - 2020-06-10
-------------------
If you pass a :class:`python:list` or :class:`python:tuple` where a
strategy was expected, the error message now mentions
:func:`~hypothesis.strategies.sampled_from` as an example strategy.
Thanks to the enthusiastic participants in the `PyCon Mentored Sprints
<https://us.pycon.org/2020/hatchery/mentoredsprints/>`__ who suggested
adding this hint.
.. _v5.16.0:
-------------------
5.16.0 - 2020-05-27
-------------------
:func:`~hypothesis.strategies.functions` can now infer the appropriate ``returns``
strategy if you pass a ``like`` function with a return-type annotation. Before,
omitting the ``returns`` argument would generate functions that always returned None.
.. _v5.15.1:
-------------------
5.15.1 - 2020-05-21
-------------------
Fix :func:`~hypothesis.strategies.from_type` with generic types under Python 3.9.
.. _v5.15.0:
-------------------
5.15.0 - 2020-05-19
-------------------
This patch fixes an error that happens when multiple threads create new strategies.
.. _v5.14.0:
-------------------
5.14.0 - 2020-05-13
-------------------
Passing ``min_magnitude=None`` to :func:`~hypothesis.strategies.complex_numbers` is now
deprecated - you can explicitly pass ``min_magnitude=0``, or omit the argument entirely.
.. _v5.13.1:
-------------------
5.13.1 - 2020-05-13
-------------------
This patch fixes an internal error in :func:`~hypothesis.strategies.from_type`
for :class:`python:typing.NamedTuple` in Python 3.9. Thanks to Michel Salim
for reporting and fixing :issue:`2427`!
.. _v5.13.0:
-------------------
5.13.0 - 2020-05-12
-------------------
This release upgrades the test statistics available via the
:ref:`--hypothesis-show-statistics <statistics>` option to include
separate information on each of the :attr:`~hypothesis.settings.phases`
(:issue:`1555`).
.. _v5.12.2:
-------------------
5.12.2 - 2020-05-12
-------------------
This patch teaches the :func:`~hypothesis.strategies.from_type` internals to
return slightly more efficient strategies for some generic sets and mappings.
.. _v5.12.1:
-------------------
5.12.1 - 2020-05-12
-------------------
This patch adds a ``# noqa`` comment for :pypi:`flake8` 3.8.0, which
disagrees with :pypi:`mypy` about how to write the type of ``...``.
.. _v5.12.0:
-------------------
5.12.0 - 2020-05-10
-------------------
This release limits the maximum duration of the shrinking phase to five minutes,
so that Hypothesis does not appear to hang when making very slow progress
shrinking a failing example (:issue:`2340`).
If one of your tests triggers this logic, we would really appreciate a bug
report to help us improve the shrinker for difficult but realistic workloads.
.. _v5.11.0:
-------------------
5.11.0 - 2020-05-07
-------------------
This release improves the interaction between :func:`~hypothesis.assume`
and the :obj:`@example() <hypothesis.example>` decorator, so that the
following test no longer fails with ``UnsatisfiedAssumption`` (:issue:`2125`):
.. code-block:: python
@given(value=floats(0, 1))
@example(value=0.56789) # used to make the test fail!
@pytest.mark.parametrize("threshold", [0.5, 1])
def test_foo(threshold, value):
assume(value < threshold)
...
.. _v5.10.5:
-------------------
5.10.5 - 2020-05-04
-------------------
If you have :pypi:`Django` installed but don't use it, this patch will make
``import hypothesis`` a few hundred milliseconds faster (e.g. 0.704s -> 0.271s).
Thanks to :pypi:`importtime-waterfall` for highlighting this problem and
`Jake Vanderplas <https://twitter.com/jakevdp/status/1130983439862181888>`__ for
the solution - it's impossible to misuse code from a module you haven't imported!
.. _v5.10.4:
-------------------
5.10.4 - 2020-04-24
-------------------
This patch improves the internals of :func:`~hypothesis.strategies.builds` type
inference, to handle recursive forward references in certain dataclasses.
This is useful for e.g. :pypi:`hypothesmith`'s forthcoming :pypi:`LibCST <libcst>` mode.
.. _v5.10.3:
-------------------
5.10.3 - 2020-04-22
-------------------
This release reverses the order in which some operations are tried during shrinking.
This should generally be a slight performance improvement, but most tests are unlikely to notice much difference.
.. _v5.10.2:
-------------------
5.10.2 - 2020-04-22
-------------------
This patch fixes :issue:`2406`, where use of :obj:`pandas:pandas.Timestamp`
objects as bounds for the :func:`~hypothesis.strategies.datetimes` strategy
caused an internal error. This bug was introduced in :ref:`version 5.8.1 <v5.8.2>`.
.. _v5.10.1:
-------------------
5.10.1 - 2020-04-19
-------------------
This release is a small internal refactoring to how shrinking interacts with :ref:`targeted property-based testing <targeted>` that should have no user user visible impact.
.. _v5.10.0:
-------------------
5.10.0 - 2020-04-18
-------------------
This release improves our support for datetimes and times around DST transitions.
:func:`~hypothesis.strategies.times` and :func:`~hypothesis.strategies.datetimes`
are now sometimes generated with ``fold=1``, indicating that they represent the
second occurrence of a given wall-time when clocks are set backwards.
This may be set even when there is no transition, in which case the ``fold``
value should be ignored.
For consistency, timezones provided by the :pypi:`pytz` package can now
generate imaginary times (such as the hour skipped over when clocks 'spring forward'
to daylight saving time, or during some historical timezone transitions).
All other timezones have always supported generation of imaginary times.
If you prefer the previous behaviour, :func:`~hypothesis.strategies.datetimes`
now takes an argument ``allow_imaginary`` which defaults to ``True`` but
can be set to ``False`` for any timezones strategy.
.. _v5.9.1:
------------------
5.9.1 - 2020-04-16
------------------
This patch fixes the rendering of :func:`~hypothesis.strategies.binary`
docstring by using the proper backticks syntax.
.. _v5.9.0:
------------------
5.9.0 - 2020-04-15
------------------
Failing tests which use :func:`~hypothesis.target` now report the highest
score observed for each target alongside the failing example(s), even without
:ref:`explicitly showing test statistics <statistics>`.
This improves the debugging workflow for tests of accuracy, which assert that the
total imprecision is within some error budget - for example, ``abs(a - b) < 0.5``.
Previously, shrinking to a minimal failing example could often make errors seem
smaller or more subtle than they really are (see `the threshold problem
<https://hypothesis.works/articles/threshold-problem/>`__, and :issue:`2180`).
.. _v5.8.6:
------------------
5.8.6 - 2020-04-15
------------------
This patch improves the docstring of :func:`~hypothesis.strategies.binary`,
the :func:`python:repr` of :func:`~hypothesis.strategies.sampled_from` on
an :class:`python:enum.Enum` subclass, and a warning in our pytest plugin.
There is no change in runtime behaviour.
.. _v5.8.5:
------------------
5.8.5 - 2020-04-15
------------------
This release (potentially very significantly) improves the performance of failing tests in some rare cases,
mostly only relevant when using :ref:`targeted property-based testing <targeted>`,
by stopping further optimisation of unrelated test cases once a failing example is found.
.. _v5.8.4:
------------------
5.8.4 - 2020-04-14
------------------
This release fixes :issue:`2395`, where under some circumstances targeted property-based testing could cause Hypothesis to get caught in an infinite loop.
.. _v5.8.3:
------------------
5.8.3 - 2020-04-12
------------------
This patch teaches :func:`~hypothesis.strategies.builds` and
:func:`~hypothesis.strategies.from_type` to use the ``__signature__``
attribute of classes where it has been set, improving our support
for :pypi:`pydantic` models (`in pydantic >= 1.5
<https://github.com/pydantic/pydantic/pull/1034>`__).
.. _v5.8.2:
------------------
5.8.2 - 2020-04-12
------------------
This release improves the performance of the part of the core engine that
deliberately generates duplicate values.
.. _v5.8.1:
------------------
5.8.1 - 2020-04-12
------------------
This patch improves :func:`~hypothesis.strategies.dates` shrinking, to simplify
year, month, and day like :func:`~hypothesis.strategies.datetimes` rather than
minimizing the number of days since 2000-01-01.
.. _v5.8.0:
------------------
5.8.0 - 2020-03-24
------------------
This release adds a :ref:`.hypothesis.fuzz_one_input <fuzz_one_input>`
attribute to :func:`@given <hypothesis.given>` tests, for easy integration
with external fuzzers such as `python-afl <https://github.com/jwilk/python-afl>`__
(supporting :issue:`171`).
.. _v5.7.2:
------------------
5.7.2 - 2020-03-24
------------------
This patch fixes :issue:`2341`, ensuring that the printed output from a
stateful test cannot use variable names before they are defined.
.. _v5.7.1:
------------------
5.7.1 - 2020-03-23
------------------
This patch fixes :issue:`2375`, preventing incorrect failure when a function
scoped fixture is overridden with a higher scoped fixture.
.. _v5.7.0:
------------------
5.7.0 - 2020-03-19
------------------
This release allows the :func:`~hypothesis.extra.numpy.array_dtypes` strategy
to generate Numpy dtypes which have `field titles in addition to field names
<https://numpy.org/doc/stable/user/basics.rec.html#field-titles>`__.
We expect this to expose latent bugs where code expects that
``set(dtype.names) == set(dtype.fields)``, though the latter may include titles.
.. _v5.6.1:
------------------
5.6.1 - 2020-03-18
------------------
This makes ``model`` a positional-only argument to
:func:`~hypothesis.extra.django.from_model`, to support models
with a field literally named "model" (:issue:`2369`).
.. _v5.6.0:
------------------
5.6.0 - 2020-02-29
------------------
This release adds an explicit warning for tests that are both decorated with
:func:`@given(...) <hypothesis.given>` and request a
:doc:`function-scoped pytest fixture <pytest:how-to/fixtures>`, because such fixtures
are only executed once for *all* Hypothesis test cases and that often causes
trouble (:issue:`377`).
It's *very* difficult to fix this on the :pypi:`pytest` side, so since 2015
our advice has been "just don't use function-scoped fixtures with Hypothesis".
Now we detect and warn about the issue at runtime!
.. _v5.5.5:
------------------
5.5.5 - 2020-02-29
------------------
This release cleans up the internal machinery for :ref:`stateful`,
after we dropped the legacy APIs in Hypothesis 5.0 (:issue:`2218`).
There is no user-visible change.
.. _v5.5.4:
------------------
5.5.4 - 2020-02-16
------------------
This patch fixes :issue:`2351`, :func:`~hypothesis.extra.numpy.arrays` would
raise a confusing error if we inferred a strategy for ``datetime64`` or
``timedelta64`` values with varying time units.
We now infer an internally-consistent strategy for such arrays, and have a more
helpful error message if an inconsistent strategy is explicitly specified.
.. _v5.5.3:
------------------
5.5.3 - 2020-02-14
------------------
This patch improves the signature of :func:`~hypothesis.strategies.builds` by
specifying ``target`` as a positional-only argument on Python 3.8 (see :pep:`570`).
The semantics of :func:`~hypothesis.strategies.builds` have not changed at all -
this just clarifies the documentation.
.. _v5.5.2:
------------------
5.5.2 - 2020-02-13
------------------
This release makes Hypothesis faster at generating test cases that contain
duplicated values in their inputs.
.. _v5.5.1:
------------------
5.5.1 - 2020-02-07
------------------
This patch has some tiny internal code clean-ups, with no user-visible change.
.. _v5.5.0:
------------------
5.5.0 - 2020-02-07
------------------
:gh-file:`Our style guide <guides/api-style.rst>` suggests that optional
parameters should usually be keyword-only arguments (see :pep:`3102`) to
prevent confusion based on positional arguments - for example,
:func:`hypothesis.strategies.floats` takes up to *four* boolean flags
and many of the Numpy strategies have both ``dims`` and ``side`` bounds.
This release converts most optional parameters in our API to use
keyword-only arguments - and adds a compatibility shim so you get
warnings rather than errors everywhere (:issue:`2130`).
.. _v5.4.2:
------------------
5.4.2 - 2020-02-06
------------------
This patch fixes compatibility with Python 3.5.2 (:issue:`2334`).
Note that :doc:`we only test the latest patch of each minor version <compatibility>`,
though as in this case we usually accept pull requests for older patch versions.
.. _v5.4.1:
------------------
5.4.1 - 2020-02-01
------------------
This patch improves the repr of :func:`~hypothesis.strategies.from_type`,
so that in most cases it will display the strategy it resolves to rather
than ``from_type(...)``. The latter form will continue to be used where
resolution is not immediately successful, e.g. invalid arguments or
recursive type definitions involving forward references.
.. _v5.4.0:
------------------
5.4.0 - 2020-01-30
------------------
This release removes support for Python 3.5.0 and 3.5.1, where the
:mod:`python:typing` module was quite immature (e.g. missing
:func:`~python:typing.overload` and :obj:`~python:typing.Type`).
Note that Python 3.5 will reach its end-of-life in September 2020,
and new releases of Hypothesis may drop support somewhat earlier.
.. note::
``pip install hypothesis`` should continue to give you the latest compatible version.
If you have somehow ended up with an incompatible version, you need to update your
packaging stack to ``pip >= 9.0`` and ``setuptools >= 24.2`` - see `here for details
<https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires>`__.
Then ``pip uninstall hypothesis && pip install hypothesis`` will get you back to
a compatible version.
.. _v5.3.1:
------------------
5.3.1 - 2020-01-26
------------------
This patch does some minor internal cleanup; there is no user-visible change.
.. _v5.3.0:
------------------
5.3.0 - 2020-01-21
------------------
The standard library :mod:`ipaddress` module is new in Python 3, and this release
adds the new :func:`~hypothesis.strategies.ip_addresses` strategy to generate
:class:`~python:ipaddress.IPv4Address`\ es and/or
:class:`~python:ipaddress.IPv6Address`\ es (depending on the ``v`` and ``network``
arguments).
If you use them in type annotations, :func:`~hypothesis.strategies.from_type` now
has strategies registered for :mod:`ipaddress` address, network, and interface types.
The provisional strategies for IP address strings are therefore deprecated.
.. _v5.2.1:
------------------
5.2.1 - 2020-01-21
------------------
This patch reverts :ref:`version 5.2 <v5.2.0>`, due to a
`strange issue <https://github.com/numpy/numpy/issues/15363>`__
where indexing an array of strings can raise an error instead of
returning an item which contains certain surrogate characters.
.. _v5.2.0:
------------------
5.2.0 - 2020-01-19
------------------
This release allows :func:`~hypothesis.extra.numpy.from_dtype` to generate
Unicode strings which cannot be encoded in UTF-8, but are valid in Numpy
arrays (which use UTF-32).
.. _v5.1.6:
------------------
5.1.6 - 2020-01-19
------------------
This patch fixes :issue:`2320`, where ``from_type(Set[Hashable])`` could raise
an internal error because ``Decimal("snan")`` is of a hashable type, but raises
an error when hashed. We now ensure that set elements and dict keys in generic
types can actually be hashed.
.. _v5.1.5:
------------------
5.1.5 - 2020-01-12
------------------
This patch fixes an internal error when running in an :pypi:`ipython` repl or
:pypi:`jupyter` notebook on Windows (:issue:`2319`), and an internal error on
Python 3.5.1 (:issue:`2318`).
.. _v5.1.4:
------------------
5.1.4 - 2020-01-11
------------------
This patch fixes a bug where errors in third-party extensions such as
:pypi:`hypothesis-trio` or :pypi:`hypothesis-jsonschema` were incorrectly
considered to be Hypothesis internal errors, which could result in
confusing error messages.
Thanks to Vincent Michel for reporting and fixing the bug!
.. _v5.1.3:
------------------
5.1.3 - 2020-01-11
------------------
This release converts the type hint comments on our public API to
:pep:`484` type annotations.
Thanks to Ivan Levkivskyi for :pypi:`com2ann` - with the refactoring
tools from :ref:`5.0.1 <v5.0.1>` it made this process remarkably easy!
.. _v5.1.2:
------------------
5.1.2 - 2020-01-09
------------------
This patch makes :func:`~hypothesis.stateful.multiple` iterable, so that
output like ``a, b = state.some_rule()`` is actually executable and
can be used to reproduce failing examples.
Thanks to Vincent Michel for reporting and fixing :issue:`2311`!
.. _v5.1.1:
------------------
5.1.1 - 2020-01-06
------------------
This patch contains many small refactorings to replace our Python 2
compatibility functions with their native Python 3 equivalents.
Since Hypothesis is now Python 3 only, there is no user-visible change.
.. _v5.1.0:
------------------
5.1.0 - 2020-01-03
------------------
This release teaches :func:`~hypothesis.strategies.from_type` how to generate
:class:`python:datetime.timezone`. As a result, you can now generate
:class:`python:datetime.tzinfo` objects without having :pypi:`pytz` installed.
If your tests specifically require :pypi:`pytz` timezones, you should be using
:func:`hypothesis.extra.pytz.timezones` instead of ``st.from_type(tzinfo)``.
.. _v5.0.1:
------------------
5.0.1 - 2020-01-01
------------------
This patch contains mostly-automated refactorings to remove code
that we only needed to support Python 2. Since Hypothesis is now
Python 3 only (hurray!), there is no user-visible change.
Our sincere thanks to the authors of :pypi:`autoflake`, :pypi:`black`,
:pypi:`isort`, and :pypi:`pyupgrade`, who have each and collectively
made this kind of update enormously easier.
.. _v5.0.0:
------------------
5.0.0 - 2020-01-01
------------------
Welcome to the next major version of Hypothesis!
There are no new features here, as we release those in minor versions.
Instead, 5.0 is a chance for us to remove deprecated features (many already
converted into no-ops), and turn a variety of warnings into errors.
If you were running on the last version of Hypothesis 4.x *without any
Hypothesis deprecation warnings*, this will be a very boring upgrade.
**In fact, nothing will change for you at all.**
.. note::
This release drops support for Python 2, which has passed
`its end of life date <https://devguide.python.org/#status-of-python-branches>`__.
The `Python 3 Statement <https://python3statement.github.io>`__ outlines our
reasons, and lists many other packages that have made the same decision.
``pip install hypothesis`` should continue to give you the latest compatible version.
If you have somehow ended up with Hypothesis 5.0 on Python 2, you need to update your
packaging stack to ``pip >= 9.0`` and ``setuptools >= 24.2`` - see `here for details
<https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires>`__.
Then ``pip uninstall hypothesis && pip install hypothesis`` will get you back to
a compatible version.
Strategies
~~~~~~~~~~
- :func:`~hypothesis.strategies.integers` bounds must be equal to an integer,
though they can still be other types.
- If :func:`~hypothesis.strategies.fractions` is passed a ``max_denominator``,
the bounds must have at most that denominator.
- :func:`~hypothesis.strategies.floats` bounds must be exactly representable as a
floating-point number with the given ``width``. If not, the error message
includes the nearest such number.
- :func:`sampled_from([]) <hypothesis.strategies.sampled_from>` is now an error.
- The values from the ``elements`` and ``fill`` strategies for
:func:`hypothesis.extra.numpy.arrays` must be losslessly representable in an
array of the given dtype.
- The ``min_size`` and ``max_size`` arguments to all collection strategies must
be of type :class:`python:int` (or ``max_size`` may be ``None``).
Miscellaneous
~~~~~~~~~~~~~
- The ``.example()`` method of strategies (intended for interactive
exploration) no longer takes a ``random`` argument.
- It is now an error to apply :obj:`@example <hypothesis.example>`,
:func:`@seed <hypothesis.seed>`, or :func:`@reproduce_failure <hypothesis.reproduce_failure>`
without also applying :func:`@given <hypothesis.given>`.
- You may pass either the ``target`` or ``targets`` argument to stateful rules, but not both.
- :obj:`~hypothesis.settings.deadline` must be ``None`` (to disable), a
:class:`~python:datetime.timedelta`, or an integer or float number of milliseconds.
- Both of :obj:`~hypothesis.settings.derandomize` and
:obj:`~hypothesis.settings.print_blob` must be either ``True`` or ``False``,
where they previously accepted other values.
- :obj:`~hypothesis.settings.stateful_step_count` must be at least one.
- :obj:`~hypothesis.settings.max_examples` must be at least one.
To disable example generation, use the :obj:`~hypothesis.settings.phases` setting.
Removals
~~~~~~~~
- ``hypothesis.stateful.GenericStateMachine`` in favor of :class:`hypothesis.stateful.RuleBasedStateMachine`
- ``hypothesis.extra.django.models.models`` in favor of :func:`hypothesis.extra.django.from_model`
and ``hypothesis.extra.django.models.add_default_field_mapping`` in favor of
:func:`hypothesis.extra.django.register_field_strategy`
- ``hypothesis.HealthCheck.hung_test``, without replacement
- ``hypothesis.settings.buffer``, without replacement
- ``hypothesis.PrintSettings``, because :obj:`hypothesis.settings.print_blob` takes ``True`` or ``False``
- ``hypothesis.settings.timeout``, in favor of :obj:`hypothesis.settings.deadline`
- ``hypothesis.unlimited`` without replacement (only only useful as argument to ``timeout``)
Hypothesis 4.x
==============
.. _v4.57.1:
-------------------
4.57.1 - 2019-12-29
-------------------
This patch improves the type hints and documentation for the
:ref:`django extra. <hypothesis-django>` There is no runtime change.
.. _v4.57.0:
-------------------
4.57.0 - 2019-12-28
-------------------
This release improves support for the SupportsOp protocols from the :mod:`python:typing`
module when using on :func:`~hypothesis.strategies.from_type` as outlined in :issue:`2292`.
The following types now generate much more varied strategies when called
with :func:`~hypothesis.strategies.from_type`:
- :class:`python:typing.SupportsAbs`
- :class:`python:typing.SupportsBytes`
- :class:`python:typing.SupportsComplex`
- :class:`python:typing.SupportsInt`
- :class:`python:typing.SupportsFloat`
- :class:`python:typing.SupportsRound`
Note that using :func:`~hypothesis.strategies.from_type` with one of the above strategies will not
ensure that the the specified function will execute successfully (ie : the strategy returned for
``from_type(typing.SupportsAbs)`` may include NaNs or things which cause the :func:`python:abs`
function to error. )
Thanks to Lea Provenzano for this patch.
.. _v4.56.3:
-------------------
4.56.3 - 2019-12-22
-------------------
This release fixes a small internal bug in shrinking which could have caused it
to perform slightly more tests than were necessary. Fixing this shouldn't have
much effect but it will make shrinking slightly faster.
.. _v4.56.2:
-------------------
4.56.2 - 2019-12-21
-------------------
This release removes an internal heuristic that was no longer providing much
benefit. It is unlikely that there will be any user visible effect.
.. _v4.56.1:
-------------------
4.56.1 - 2019-12-19
-------------------
This release further improves the optimisation algorithm for :ref:`targeted property-based testing <targeted>`.
.. _v4.56.0:
-------------------
4.56.0 - 2019-12-18
-------------------
This release enables deprecation warnings even when the
:obj:`~hypothesis.settings.verbosity` setting is ``quiet``,
in preparation for Hypothesis 5.0 (:issue:`2218`).
Warnings can still be filtered by the standard mechanisms
provided in the standard-library :mod:`python:warnings` module.
.. _v4.55.4:
-------------------
4.55.4 - 2019-12-18
-------------------
This release improves Hypothesis's management of the set of test cases it
tracks between runs. It will only do anything if you have the
:obj:`~hypothesis.Phase.target` phase enabled and an example database set.
In those circumstances it should result in a more thorough and faster set of examples
that are tried on each run.
.. _v4.55.3:
-------------------
4.55.3 - 2019-12-18
-------------------
This release makes Hypothesis better at generating test cases where generated
values are duplicated in different parts of the test case. This will be
especially noticeable with reasonably complex values, as it was already able
to do this for simpler ones such as integers or floats.
.. _v4.55.2:
-------------------
4.55.2 - 2019-12-17
-------------------
This release expands the set of test cases that Hypothesis saves in its
database for future runs to include a representative set of "structurally
different" test cases - e.g. it might try to save test cases where a given list
is empty or not.
Currently this is unlikely to have much user visible impact except to produce
slightly more consistent behaviour between consecutive runs of a test suite.
It is mostly groundwork for future improvements which will exploit this
functionality more effectively.
.. _v4.55.1:
-------------------
4.55.1 - 2019-12-16
-------------------
This patch fixes :issue:`2257`, where :func:`~hypothesis.strategies.from_type`
could incorrectly generate bytestrings when passed a generic
:class:`python:typing.Sequence` such as ``Sequence[set]``.
.. _v4.55.0:
-------------------
4.55.0 - 2019-12-16
-------------------
This release adds database support for :ref:`targeted property-based testing <targeted>`,
so the best examples based on the targeting will be saved and reused between runs.
This is mostly laying groundwork for future features in this area, but
will also make targeted property-based tests more useful during development,
where the same tests tend to get run over and over again.
If :obj:`~hypothesis.settings.max_examples` is large, this may increase memory
usage significantly under some circumstances, but these should be relatively
rare.
This release also adds a dependency on the :pypi:`sortedcontainers` package.
.. _v4.54.2:
-------------------
4.54.2 - 2019-12-16
-------------------
This release improves the optimisation algorithm for :ref:`targeted property-based testing <targeted>`,
so that it will find higher quality results more reliably. Specifically, in cases where it would previously have got near a local optimum,
it will now tend to achieve the locally optimal value.
.. _v4.54.1:
-------------------
4.54.1 - 2019-12-16
-------------------
This release is mostly internal changes in support of better testing of the
core engine. You are unlikely to see much effect, although some internal
heuristics have changed slightly.
.. _v4.54.0:
-------------------
4.54.0 - 2019-12-15
-------------------
This release adds a dedicated phase for :ref:`targeted property-based testing <targeted>`,
and (somewhat) improves the targeting algorithm so that it will find higher quality results more reliably.
This comes at a cost of making it more likely to get stuck in a local optimum.
.. _v4.53.3:
-------------------
4.53.3 - 2019-12-15
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` with
:class:`python:typing.Hashable` and :class:`python:typing.Sized`,
which previously failed with an internal error on Python 3.7 or later.
Thanks to Lea Provenzano for both reporting :issue:`2272`
and writing the patch!
.. _v4.53.2:
-------------------
4.53.2 - 2019-12-11
-------------------
This release reorganises a number of the Hypothesis internal modules into a
package structure. If you are only depending on the public API it should have
no effect. If you are depending on the internal API (which you shouldn't be,
and which we don't guarantee compatibility on) you may have to rename some
imports.
.. _v4.53.1:
-------------------
4.53.1 - 2019-12-09
-------------------
This release changes the size distribution of the number of steps run in
stateful testing: It will now almost always run the maximum number of steps
permitted.
.. _v4.53.0:
-------------------
4.53.0 - 2019-12-09
-------------------
:ref:`statistics` now include the best score seen for each label, which can help avoid
`the threshold problem <https://hypothesis.works/articles/threshold-problem/>`__ when
the minimal example shrinks right down to the threshold of failure (:issue:`2180`).
.. _v4.52.0:
-------------------
4.52.0 - 2019-12-09
-------------------
This release changes the ``stateful_step_count`` setting to raise an error if
set to ``0``. This is a backwards compatible change because a value of ``0``
would never have worked and attempting to run it would have resulted in an
internal assertion error.
.. _v4.51.1:
-------------------
4.51.1 - 2019-12-09
-------------------
This release makes a small internal change to the distribution of test cases.
It is unlikely to have much user visible impact.
.. _v4.51.0:
-------------------
4.51.0 - 2019-12-07
-------------------
This release deprecates use of :obj:`@example <hypothesis.example>`,
:func:`@seed <hypothesis.seed>`, or :func:`@reproduce_failure <hypothesis.reproduce_failure>`
without :func:`@given <hypothesis.given>`.
Thanks to Nick Anyos for the patch!
.. _v4.50.8:
-------------------
4.50.8 - 2019-12-05
-------------------
This patch makes certain uses of Bundles more efficient in stateful testing (:issue:`2078`).
.. _v4.50.7:
-------------------
4.50.7 - 2019-12-05
-------------------
This release refactors some of Hypothesis's internal interfaces for representing
data generation. It should have no user visible effect.
.. _v4.50.6:
-------------------
4.50.6 - 2019-12-02
-------------------
This patch removes some old debugging helpers in our Numpy extra which have
not been needed since :issue:`1963` and :issue:`2245`.
.. _v4.50.5:
-------------------
4.50.5 - 2019-12-01
-------------------
This patch fixes :issue:`2229`, where Numpy arrays of unsized strings would
only ever have strings of size one due to an interaction between our generation
logic and Numpy's allocation strategy.
.. _v4.50.4:
-------------------
4.50.4 - 2019-12-01
-------------------
This patch fixes a rare internal error in strategies for a list of
unique items sampled from a short non-unique sequence (:issue:`2247`).
The bug was discovered via :pypi:`hypothesis-jsonschema`.
.. _v4.50.3:
-------------------
4.50.3 - 2019-12-01
-------------------
This release improves the error message when
:func:`@settings <hypothesis.settings>` tries to inherit settings from a
``parent`` argument that isn't a ``settings`` instance.
.. _v4.50.2:
-------------------
4.50.2 - 2019-11-29
-------------------
This release improves Hypothesis's "Falsifying example" output, by breaking
output across multiple lines where necessary, and by removing irrelevant
information from the stateful testing output.
.. _v4.50.1:
-------------------
4.50.1 - 2019-11-29
-------------------
This patch adds :pypi:`flake8-comprehensions` to our linter suite. There is no
user-visible change - expect perhaps via some strange microbenchmarks - but
certain parts of the code now have a clear and more consistent style.
.. _v4.50.0:
-------------------
4.50.0 - 2019-11-28
-------------------
This release fixes some cases where we might previously have failed to run the
validation logic for some strategies. As a result tests which would previously
have been silently testing significantly less than they should may now start
to raise ``InvalidArgument`` now that these errors are caught.
.. _v4.49.0:
-------------------
4.49.0 - 2019-11-28
-------------------
This release significantly improves the data distribution in :ref:`rule based stateful testing <stateful>`,
by using a technique called `Swarm Testing (Groce, Alex, et al. "Swarm testing."
Proceedings of the 2012 International Symposium on Software Testing and Analysis. ACM, 2012.) <https://agroce.github.io/issta12.pdf>`_
to select which rules are run in any given test case. This should allow it to find many issues that it would previously have missed.
This change is likely to be especially beneficial for stateful tests with large numbers of rules.
.. _v4.48.1:
-------------------
4.48.1 - 2019-11-28
-------------------
This release adds some heuristics to test case generation that try to ensure that test cases generated early on will be relatively small.
This fixes a bug introduced in :ref:`Hypothesis 4.42.0 <v4.42.0>` which would cause occasional
:obj:`~hypothesis.HealthCheck.too_slow` failures on some tests.
.. _v4.48.0:
-------------------
4.48.0 - 2019-11-28
-------------------
This release revokes the deprecation of ``find``, as we've now rebuilt it on top of
``@given``, which means it has minimal maintenance burden and we're happy to support it.
.. _v4.47.5:
-------------------
4.47.5 - 2019-11-28
-------------------
This release rebuilds ``find()`` on top of ``@given`` in order to have more code in common.
It should have minimal user visible effect.
.. _v4.47.4:
-------------------
4.47.4 - 2019-11-27
-------------------
This patch removes an internal compatibility shim that we no longer need.
.. _v4.47.3:
-------------------
4.47.3 - 2019-11-26
-------------------
This patch fixes several typos in our docstrings and comments,
with no change in behaviour. Thanks to Dmitry Dygalo for
identifying and fixing them!
.. _v4.47.2:
-------------------
4.47.2 - 2019-11-25
-------------------
This release fixes an internal issue where Hypothesis would sometimes generate
test cases that were above its intended maximum size. This would only have
happened rarely and probably would not have caused major problems when it did.
Users of the new :ref:`targeted property-based testing <targeted>` might
see minor impact (possibly slightly faster tests and slightly worse target scores),
but only in the unlikely event that they were hitting this problem. Other users
should not see any effect at all.
.. _v4.47.1:
-------------------
4.47.1 - 2019-11-24
-------------------
This release removes some unused code from the core engine.
There is no user-visible change.
.. _v4.47.0:
-------------------
4.47.0 - 2019-11-24
-------------------
This release commonizes some code between running explicit examples and normal test execution.
The main user visible impact of this is that deadlines are now enforced when running explicit examples.
.. _v4.46.1:
-------------------
4.46.1 - 2019-11-23
-------------------
This patch ensures that a KeyboardInterrupt received during example generation
is not treated as a mystery test failure but instead propagates to the top
level, not recording the interrupted generation in the conjecture data tree.
Thanks to Anne Archibald for identifying and fixing the problem.
.. _v4.46.0:
-------------------
4.46.0 - 2019-11-22
-------------------
This release changes the behaviour of :func:`~hypothesis.strategies.floats`
when excluding signed zeros - ``floats(max_value=0.0, exclude_max=True)``
can no longer generate ``-0.0`` nor the much rarer
``floats(min_value=-0.0, exclude_min=True)`` generate ``+0.0``.
The correct interaction between signed zeros and exclusive endpoints was unclear;
we now enforce the invariant that :func:`~hypothesis.strategies.floats` will
never generate a value equal to an excluded endpoint (:issue:`2201`).
If you prefer the old behaviour, you can pass ``floats(max_value=-0.0)`` or
``floats(min_value=0.0)`` which is exactly equivalent and has not changed.
If you had *two* endpoints equal to zero, we recommend clarifying your tests by using
:func:`~hypothesis.strategies.just` or :func:`~hypothesis.strategies.sampled_from`
instead of :func:`~hypothesis.strategies.floats`.
.. _v4.45.1:
-------------------
4.45.1 - 2019-11-20
-------------------
This patch improves the error message when invalid arguments are passed
to :func:`~hypothesis.stateful.rule` or :func:`~hypothesis.stateful.invariant`
(:issue:`2149`).
Thanks to Benjamin Palmer for this bugfix!
.. _v4.45.0:
-------------------
4.45.0 - 2019-11-20
-------------------
This release supports :obj:`python:typing.Final` and :obj:`python:typing.TypedDict`
in :func:`~hypothesis.strategies.from_type`.
.. _v4.44.5:
-------------------
4.44.5 - 2019-11-20
-------------------
This patch disables our :pypi:`pytest` plugin when running on versions
of :pypi:`pytest` before 4.3, the oldest our plugin supports.
Note that at time of writing the Pytest developers only support 4.6 and later!
Hypothesis *tests* using :func:`@given() <hypothesis.given>` work on any
test runner, but our integrations to e.g. avoid example database collisions
when combined with ``@pytest.mark.parametrize`` eventually drop support
for obsolete versions.
.. _v4.44.4:
-------------------
4.44.4 - 2019-11-20
-------------------
This patch adds some internal comments and clarifications to the Hypothesis
implementation. There is no user-visible change.
.. _v4.44.3:
-------------------
4.44.3 - 2019-11-20
-------------------
This patch avoids importing test runners such as :pypi:`pytest`, :pypi:`unittest2`,
or :pypi:`nose` solely to access their special "skip test" exception types -
if the module is not in :obj:`sys.modules`, the exception can't be raised anyway.
This fixes a problem where importing an otherwise unused module could cause
spurious errors due to import-time side effects (and possibly ``-Werror``).
.. _v4.44.2:
-------------------
4.44.2 - 2019-11-12
-------------------
This release fixes :func:`@given <hypothesis.given>` to only complain about
missing keyword-only arguments if the associated test function is actually
called.
This matches the behaviour of other ``InvalidArgument`` errors produced by
``@given``.
.. _v4.44.1:
-------------------
4.44.1 - 2019-11-11
-------------------
This patch allows Hypothesis to run in environments that do not specify
a ``__file__``, such as a :mod:`python:zipapp` (:issue:`2196`).
.. _v4.44.0:
-------------------
4.44.0 - 2019-11-11
-------------------
This release adds a ``signature`` argument to
:func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes` (:issue:`2174`),
which allows us to generate shapes which are valid for functions like
:data:`np.matmul() <numpy:numpy.matmul>` that require shapes which are not simply broadcastable.
Thanks to everyone who has contributed to this feature over the last year,
and a particular shout-out to Zac Hatfield-Dodds and Ryan Soklaski for
:func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes` and to
Ryan Turner for the downstream :pypi:`hypothesis-gufunc` project.
.. _v4.43.9:
-------------------
4.43.9 - 2019-11-11
-------------------
This patch fixes :issue:`2108`, where the first test using
:func:`~hypothesis.strategies.data` to draw from :func:`~hypothesis.strategies.characters`
or :func:`~hypothesis.strategies.text` would be flaky due to unreliable test timings.
Time taken by lazy instantiation of strategies is now counted towards drawing from
the strategy, rather than towards the deadline for the test function.
.. _v4.43.8:
-------------------
4.43.8 - 2019-11-08
-------------------
This release ensures that the strategies passed to
:func:`@given <hypothesis.given>` are properly validated when applied to a test
method inside a test class.
This should result in clearer error messages when some of those strategies are
invalid.
.. _v4.43.7:
-------------------
4.43.7 - 2019-11-08
-------------------
This release changes how Hypothesis manages its search space in cases where it
generates redundant data. This should cause it to generate significantly fewer
duplicated examples (especially with short integer ranges), and may cause it to
produce more useful examples in some cases (especially ones where there is a
significant amount of filtering).
.. _v4.43.6:
-------------------
4.43.6 - 2019-11-07
-------------------
This patch refactors ``width`` handling in :func:`~hypothesis.strategies.floats`;
you may notice small performance improvements but the main purpose is to
enable work on :issue:`1704` (improving shrinking of bounded floats).
.. _v4.43.5:
-------------------
4.43.5 - 2019-11-06
-------------------
This patch removes an unused internal flag.
There is no user-visible change.
.. _v4.43.4:
-------------------
4.43.4 - 2019-11-05
-------------------
This patch corrects the exception type and error message you get if you attempt
to use :func:`~hypothesis.strategies.data` to draw from something which is not
a strategy. This never worked, but the error is more helpful now.
.. _v4.43.3:
-------------------
4.43.3 - 2019-11-05
-------------------
We've adopted :pypi:`flake8-bugbear` to check for a few more style issues,
and this patch implements the minor internal cleanups it suggested.
There is no user-visible change.
.. _v4.43.2:
-------------------
4.43.2 - 2019-11-05
-------------------
This patch fixes the formatting of some documentation,
but there is no change to any executed code.
.. _v4.43.1:
-------------------
4.43.1 - 2019-11-04
-------------------
Python 3.8's new :obj:`python:typing.Literal` type - see :pep:`586` for
details - is now supported in :func:`~hypothesis.strategies.from_type`.
.. _v4.43.0:
-------------------
4.43.0 - 2019-11-04
-------------------
This release adds the strategy :func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes`, which generates multiple array shapes that are mutually broadcast-compatible with an optional user-specified base-shape.
This is a generalisation of :func:`~hypothesis.extra.numpy.broadcastable_shapes`.
It relies heavily on non-public internals for performance when generating and shrinking examples.
We intend to support generating shapes matching a ufunc signature in a future version (:issue:`2174`).
Thanks to Ryan Soklaski, Zac Hatfield-Dodds, and @rdturnermtl who contributed to this new feature.
.. _v4.42.10:
--------------------
4.42.10 - 2019-11-03
--------------------
This release fixes :func:`~hypothesis.strategies.from_type` when used with
bounded or constrained :obj:`python:typing.TypeVar` objects (:issue:`2094`).
Previously, distinct typevars with the same constraints would be treated as all
single typevar, and in cases where a typevar bound was resolved to a union of
subclasses this could result in mixed types being generated for that typevar.
.. _v4.42.9:
-------------------
4.42.9 - 2019-11-03
-------------------
This patch ensures that the default value :func:`~hypothesis.extra.numpy.broadcastable_shapes`
chooses for ``max_dims`` is always valid (at most 32), even if you pass ``min_dims=32``.
.. _v4.42.8:
-------------------
4.42.8 - 2019-11-02
-------------------
This patch ensures that we only add profile information to the pytest header
if running either pytest or Hypothesis in verbose mode, matching the
`builtin cache plugin <https://docs.pytest.org/en/latest/how-to/cache.html>`__
(:issue:`2155`).
.. _v4.42.7:
-------------------
4.42.7 - 2019-11-02
-------------------
This patch makes stateful step printing expand the result of a step into
multiple variables when you return :func:`~hypothesis.stateful.multiple` (:issue:`2139`).
Thanks to Joseph Weston for reporting and fixing this bug!
.. _v4.42.6:
-------------------
4.42.6 - 2019-11-02
-------------------
This release fixes a bug (:issue:`2166`) where a Unicode character info
cache file was generated but never used on subsequent test runs, causing tests
to run more slowly than they should have.
Thanks to Robert Knight for this bugfix!
.. _v4.42.5:
-------------------
4.42.5 - 2019-11-01
-------------------
This patch corrects some internal documentation. There is no user-visible change.
.. _v4.42.4:
-------------------
4.42.4 - 2019-11-01
-------------------
This release fixes a bug (:issue:`2160`) where decorators applied after
:func:`@settings <hypothesis.settings>` and before
:func:`@given <hypothesis.given>` were ignored.
Thanks to Tom Milligan for this bugfix!
.. _v4.42.3:
-------------------
4.42.3 - 2019-10-30
-------------------
This release updates Hypothesis's formatting to the new version of :pypi:`black`, and
has absolutely no user visible effect.
.. _v4.42.2:
-------------------
4.42.2 - 2019-10-30
-------------------
This release fixes a bug in :func:`~hypothesis.strategies.recursive` which would
have meant that in practice ``max_leaves`` was treated as if it was lower than
it actually is - specifically it would be capped at the largest power of two
smaller than it. It is now handled correctly.
.. _v4.42.1:
-------------------
4.42.1 - 2019-10-30
-------------------
Python 3.8's new :class:`python:typing.SupportsIndex` type - see :pep:`357`
for details - is now supported in :func:`~hypothesis.strategies.from_type`.
Thanks to Grigorios Giannakopoulos for the patch!
.. _v4.42.0:
-------------------
4.42.0 - 2019-10-27
-------------------
This release significantly simplifies Hypothesis's internal logic for data
generation, by removing a number of heuristics of questionable or unproven
value.
The results of this change will vary significantly from test to test. Most
test suites will see significantly faster data generation and lower memory
usage. The "quality" of the generated data may go up or down depending on your
particular test suites.
If you see any significant regressions in Hypothesis's ability to find bugs in
your code as a result of this release, please file an issue to let us know.
Users of the new :ref:`targeted property-based testing <targeted>`
functionality are reasonably likely to see *improvements* in data generation,
as this release changes the search algorithm for targeted property based
testing to one that is more likely to be productive than the existing approach.
.. _v4.41.3:
-------------------
4.41.3 - 2019-10-21
-------------------
This patch is to ensure that our internals remain comprehensible to
:pypi:`mypy` 0.740 - there is no user-visible change.
.. _v4.41.2:
-------------------
4.41.2 - 2019-10-17
-------------------
This patch changes some internal hashes to SHA384, to better support
users subject to FIPS-140. There is no user-visible API change.
Thanks to Paul Kehrer for this contribution!
.. _v4.41.1:
-------------------
4.41.1 - 2019-10-16
-------------------
This release makes ``--hypothesis-show-statistics`` much more useful for
tests using a :class:`~hypothesis.stateful.RuleBasedStateMachine`, by
simplifying the reprs so that events are aggregated correctly.
.. _v4.41.0:
-------------------
4.41.0 - 2019-10-16
-------------------
This release upgrades the :func:`~hypothesis.strategies.fixed_dictionaries`
strategy to support ``optional`` keys (:issue:`1913`).
.. _v4.40.2:
-------------------
4.40.2 - 2019-10-16
-------------------
This release makes some minor internal changes in support of improving the
Hypothesis test suite. It should not have any user visible impact.
.. _v4.40.1:
-------------------
4.40.1 - 2019-10-14
-------------------
This release changes how Hypothesis checks if a parameter to a test function is a mock object.
It is unlikely to have any noticeable effect, but may result in a small performance improvement,
especially for test functions where a mock object is being passed as the first argument.
.. _v4.40.0:
-------------------
4.40.0 - 2019-10-09
-------------------
This release fixes a bug where our example database logic did not distinguish
between failing examples based on arguments from a ``@pytest.mark.parametrize(...)``.
This could in theory cause data loss if a common failure overwrote a rare one, and
in practice caused occasional file-access collisions in highly concurrent workloads
(e.g. during a 300-way parametrize on 16 cores).
For internal reasons this also involves bumping the minimum supported version of
:pypi:`pytest` to 4.3
Thanks to Peter C Kroon for the Hacktoberfest patch!
.. _v4.39.3:
-------------------
4.39.3 - 2019-10-09
-------------------
This patch improves our type hints on the :func:`~hypothesis.strategies.emails`,
:func:`~hypothesis.strategies.functions`, :func:`~hypothesis.strategies.integers`,
:func:`~hypothesis.strategies.iterables`, and :func:`~hypothesis.strategies.slices`
strategies, as well as the ``.filter()`` method.
There is no runtime change, but if you use :pypi:`mypy` or a similar
type-checker on your tests the results will be a bit more precise.
.. _v4.39.2:
-------------------
4.39.2 - 2019-10-09
-------------------
This patch improves the performance of unique collections such as
:func:`~hypothesis.strategies.sets` of :func:`~hypothesis.strategies.just`
or :func:`~hypothesis.strategies.booleans` strategies. They were already
pretty good though, so you're unlikely to notice much!
.. _v4.39.1:
-------------------
4.39.1 - 2019-10-09
-------------------
If a value in a dict passed to :func:`~hypothesis.strategies.fixed_dictionaries`
is not a strategy, Hypothesis now tells you which one.
.. _v4.39.0:
-------------------
4.39.0 - 2019-10-07
-------------------
This release adds the :func:`~hypothesis.extra.numpy.basic_indices` strategy,
to generate `basic indexes <https://numpy.org/doc/stable/user/basics.indexing.html>`__
for arrays of the specified shape (:issue:`1930`).
It generates tuples containing some mix of integers, :obj:`python:slice` objects,
``...`` (Ellipsis), and :obj:`numpy:numpy.newaxis`; which when used to index an array
of the specified shape produce either a scalar or a shared-memory view of the array.
Note that the index tuple may be longer or shorter than the array shape, and may
produce a view with another dimensionality again!
Thanks to Lampros Mountrakis, Ryan Soklaski, and Zac Hatfield-Dodds for their
collaboration on this surprisingly subtle strategy!
.. _v4.38.3:
-------------------
4.38.3 - 2019-10-04
-------------------
This patch defers creation of the ``.hypothesis`` directory until we have
something to store in it, meaning that it will appear when Hypothesis is
used rather than simply installed.
Thanks to Peter C Kroon for the Hacktoberfest patch!
.. _v4.38.2:
-------------------
4.38.2 - 2019-10-02
-------------------
This patch bumps our dependency on :pypi:`attrs` to ``>=19.2.0``;
but there are no user-visible changes to Hypothesis.
.. _v4.38.1:
-------------------
4.38.1 - 2019-10-01
-------------------
This is a comment-only patch which tells :pypi:`mypy` 0.730 to ignore
some internal compatibility shims we use to support older Pythons.
.. _v4.38.0:
-------------------
4.38.0 - 2019-10-01
-------------------
This release adds the :func:`hypothesis.target` function, which implements
:ref:`targeted property-based testing <targeted>`
(:issue:`1779`).
By calling :func:`~hypothesis.target` in your test function, Hypothesis can
do a hill-climbing search for bugs. If you can calculate a suitable metric
such as the load factor or length of a queue, this can help you find bugs with
inputs that are highly improbably from unguided generation - however good our
heuristics, example diversity, and deduplication logic might be. After all,
those features are at work in targeted PBT too!
.. _v4.37.0:
-------------------
4.37.0 - 2019-09-28
-------------------
This release emits a warning if you use the ``.example()`` method of
a strategy in a non-interactive context.
:func:`~hypothesis.given` is a much better choice for writing tests,
whether you care about performance, minimal examples, reproducing
failures, or even just the variety of inputs that will be tested!
.. _v4.36.2:
-------------------
4.36.2 - 2019-09-20
-------------------
This patch disables part of the :mod:`typing`-based inference for the
:pypi:`attrs` package under Python 3.5.0, which has some incompatible
internal details (:issue:`2095`).
.. _v4.36.1:
-------------------
4.36.1 - 2019-09-17
-------------------
This patch fixes a bug in strategy inference for :pypi:`attrs` classes where
Hypothesis would fail to infer a strategy for attributes of a generic type
such as ``Union[int, str]`` or ``List[bool]`` (:issue:`2091`).
Thanks to Jonathan Gayvallet for the bug report and this patch!
.. _v4.36.0:
-------------------
4.36.0 - 2019-09-09
-------------------
This patch deprecates ``min_len`` or ``max_len`` of 0 in
:func:`~hypothesis.extra.numpy.byte_string_dtypes` and
:func:`~hypothesis.extra.numpy.unicode_string_dtypes`.
The lower limit is now 1.
Numpy uses a length of 0 in these dtypes to indicate an undetermined size,
chosen from the data at array creation.
However, as the :func:`~hypothesis.extra.numpy.arrays` strategy creates arrays
before filling them, strings were truncated to 1 byte.
.. _v4.35.1:
-------------------
4.35.1 - 2019-09-09
-------------------
This patch improves the messaging that comes from invalid size arguments
to collection strategies such as :func:`~hypothesis.strategies.lists`.
.. _v4.35.0:
-------------------
4.35.0 - 2019-09-04
-------------------
This release improves the :func:`~hypothesis.extra.lark.from_lark` strategy,
tightening argument validation and adding the ``explicit`` argument to allow use
with terminals that use ``@declare`` instead of a string or regular expression.
This feature is required to handle features such as indent and dedent tokens
in Python code, which can be generated with the :pypi:`hypothesmith` package.
.. _v4.34.0:
-------------------
4.34.0 - 2019-08-23
-------------------
The :func:`~hypothesis.strategies.from_type` strategy now knows to look up
the subclasses of abstract types, which cannot be instantiated directly.
This is very useful for :pypi:`hypothesmith` to support :pypi:`libCST <libcst>`.
.. _v4.33.1:
-------------------
4.33.1 - 2019-08-21
-------------------
This patch works around a crash when an incompatible version of Numpy
is installed under PyPy 5.10 (Python 2.7).
If you are still using Python 2, please upgrade to Python 3 as soon
as possible - it will be unsupported at the end of this year.
.. _v4.33.0:
-------------------
4.33.0 - 2019-08-20
-------------------
This release improves the :func:`~hypothesis.provisional.domains`
strategy, as well as the :func:`~hypothesis.provisional.urls` and
the :func:`~hypothesis.strategies.emails` strategies which use it.
These strategies now use the full IANA list of Top Level Domains
and are correct as per :rfc:`1035`.
Passing tests using these strategies may now fail.
Thanks to `TechDragon <https://github.com/techdragon>`__ for this improvement.
.. _v4.32.3:
-------------------
4.32.3 - 2019-08-05
-------------------
This patch tidies up the repr of several ``settings``-related objects,
at runtime and in the documentation, and deprecates the undocumented
edge case that ``phases=None`` was treated like ``phases=tuple(Phase)``.
It *also* fixes :func:`~hypothesis.extra.lark.from_lark` with
:pypi:`lark 0.7.2 <lark-parser>` and later.
.. _v4.32.2:
-------------------
4.32.2 - 2019-07-30
-------------------
This patch updates some internal comments for :pypi:`mypy` 0.720.
There is no user-visible impact.
.. _v4.32.1:
-------------------
4.32.1 - 2019-07-29
-------------------
This release changes how the shrinker represents its progress internally. For large generated test cases
this should result in significantly less memory usage and possibly faster shrinking. Small generated
test cases may be slightly slower to shrink but this shouldn't be very noticeable.
.. _v4.32.0:
-------------------
4.32.0 - 2019-07-28
-------------------
This release makes :func:`~hypothesis.extra.numpy.arrays` more pedantic about
``elements`` strategies that cannot be exactly represented as array elements.
In practice, you will see new warnings if you were using a ``float16`` or
``float32`` dtype without passing :func:`~hypothesis.strategies.floats` the
``width=16`` or ``width=32`` arguments respectively.
The previous behaviour could lead to silent truncation, and thus some elements
being equal to an explicitly excluded bound (:issue:`1899`).
.. _v4.31.1:
-------------------
4.31.1 - 2019-07-28
-------------------
This patch changes an internal use of MD5 to SHA hashes, to better support
users subject to FIPS-140. There is no user-visible or API change.
Thanks to Alex Gaynor for this patch.
.. _v4.31.0:
-------------------
4.31.0 - 2019-07-24
-------------------
This release simplifies the logic of the :attr:`~hypothesis.settings.print_blob` setting by removing the option to set it to ``PrintSettings.INFER``.
As a result the ``print_blob`` setting now takes a single boolean value, and the use of ``PrintSettings`` is deprecated.
.. _v4.28.2:
-------------------
4.28.2 - 2019-07-14
-------------------
This patch improves the docstrings of several Hypothesis strategies, by
clarifying markup and adding cross-references. There is no runtime change.
Thanks to Elizabeth Williams and Serah Njambi Rono for their contributions
at the SciPy 2019 sprints!
.. _v4.28.1:
-------------------
4.28.1 - 2019-07-12
-------------------
This patch improves the behaviour of the :func:`~hypothesis.strategies.text`
strategy when passed an ``alphabet`` which is not a strategy. The value is
now interpreted as ``include_characters`` to :func:`~hypothesis.strategies.characters`
instead of a sequence for :func:`~hypothesis.strategies.sampled_from`, which
standardises the distribution of examples and the shrinking behaviour.
You can get the previous behaviour by using
``lists(sampled_from(alphabet)).map("".map)`` instead.
.. _v4.28.0:
-------------------
4.28.0 - 2019-07-11
-------------------
This release deprecates ``find()``. The ``.example()`` method is a better
replacement if you want *an* example, and for the rare occasions where you
want the *minimal* example you can get it from :func:`@given <hypothesis.given>`.
:func:`@given <hypothesis.given>` has steadily outstripped ``find()`` in both
features and performance over recent years, and as we do not have the resources
to maintain and test both we think it is better to focus on just one.
.. _v4.27.0:
-------------------
4.27.0 - 2019-07-08
-------------------
This release refactors the implementation of the ``.example()`` method,
to more accurately represent the data which will be generated by
:func:`@given <hypothesis.given>`.
As a result, calling ``s.example()`` on an empty strategy ``s``
(such as :func:`~hypothesis.strategies.nothing`) now raises ``Unsatisfiable``
instead of the old ``NoExamples`` exception.
.. _v4.26.4:
-------------------
4.26.4 - 2019-07-07
-------------------
This patch ensures that the Pandas extra will keep working when Python 3.8
removes abstract base classes from the top-level :obj:`python:collections`
namespace. This also fixes the relevant warning in Python 3.7, but there
is no other difference in behaviour and you do not need to do anything.
.. _v4.26.3:
-------------------
4.26.3 - 2019-07-05
-------------------
This release fixes :issue:`2027`, by changing the way Hypothesis tries to generate distinct examples to be more efficient.
This may result in slightly different data distribution, and should improve generation performance in general,
but should otherwise have minimal user impact.
.. _v4.26.2:
-------------------
4.26.2 - 2019-07-04
-------------------
This release fixes :issue:`1864`, where some simple tests would perform very slowly,
because they would run many times with each subsequent run being progressively slower.
They will now stop after a more reasonable number of runs without hitting this problem.
Unless you are hitting exactly this issue, it is unlikely that this release will have any effect,
but certain classes of custom generators that are currently very slow may become a bit faster,
or start to trigger health check failures.
.. _v4.26.1:
-------------------
4.26.1 - 2019-07-04
-------------------
This release adds the strategy :func:`~hypothesis.extra.numpy.integer_array_indices`,
which generates tuples of Numpy arrays that can be used for
`advanced indexing <http://www.pythonlikeyoumeanit.com/Module3_IntroducingNumpy/AdvancedIndexing.html#Integer-Array-Indexing>`_
to select an array of a specified shape.
.. _v4.26.0:
-------------------
4.26.0 - 2019-07-04
-------------------
This release significantly improves the performance of drawing unique collections whose
elements are drawn from :func:`~hypothesis.strategies.sampled_from` strategies.
As a side effect, this detects an error condition that would previously have
passed silently: When the ``min_size`` argument on a collection with distinct elements
is greater than the number of elements being sampled, this will now raise an error.
.. _v4.25.1:
-------------------
4.25.1 - 2019-07-03
-------------------
This release removes some defunct internal functionality that was only being used
for testing. It should have no user visible impact.
.. _v4.25.0:
-------------------
4.25.0 - 2019-07-03
-------------------
This release deprecates and disables the ``buffer_size`` setting,
which should have been treated as a private implementation detail
all along. We recommend simply deleting this settings argument.
.. _v4.24.6:
-------------------
4.24.6 - 2019-06-26
-------------------
This patch makes :func:`~hypothesis.strategies.datetimes` more efficient,
as it now handles short months correctly by construction instead of filtering.
.. _v4.24.5:
-------------------
4.24.5 - 2019-06-23
-------------------
This patch improves the development experience by simplifying the tracebacks
you will see when e.g. you have used the ``.map(...)`` method of a strategy
and the mapped function raises an exception.
No new exceptions can be raised, nor existing exceptions change anything but
their traceback. We're simply using if-statements rather than exceptions for
control flow in a certain part of the internals!
.. _v4.24.4:
-------------------
4.24.4 - 2019-06-21
-------------------
This patch fixes :issue:`2014`, where our compatibility layer broke with version
3.7.4 of the :pypi:`typing` module backport on PyPI.
This issue only affects Python 2. We remind users that Hypothesis, like many other
packages, `will drop Python 2 support on 2020-01-01 <https://python3statement.github.io>`__
and already has several features that are only available on Python 3.
.. _v4.24.3:
-------------------
4.24.3 - 2019-06-07
-------------------
This patch improves the implementation of an internal wrapper on Python 3.8
beta1 (and will break on the alphas; but they're not meant to be stable).
On other versions, there is no change at all.
Thanks to Daniel Hahler for the patch, and Victor Stinner for his work
on :bpo:`37032` that made it possible.
.. _v4.24.2:
-------------------
4.24.2 - 2019-06-06
-------------------
Deprecation messages for functions in ``hypothesis.extra.django.models`` now
explicitly name the deprecated function to make it easier to track down usages.
Thanks to Kristian Glass for this contribution!
.. _v4.24.1:
-------------------
4.24.1 - 2019-06-04
-------------------
This patch fixes :issue:`1999`, a spurious bug raised when a :func:`@st.composite <hypothesis.strategies.composite>` function was passed a keyword-only argument.
Thanks to Jim Nicholls for his fantastic bug report.
.. _v4.24.0:
-------------------
4.24.0 - 2019-05-29
-------------------
This release deprecates ``GenericStateMachine``, in favor of
:class:`~hypothesis.stateful.RuleBasedStateMachine`. Rule-based stateful
testing is significantly faster, especially during shrinking.
If your use-case truly does not fit rule-based stateful testing,
we recommend writing a custom test function which drives your specific
control-flow using :func:`~hypothesis.strategies.data`.
.. _v4.23.9:
-------------------
4.23.9 - 2019-05-28
-------------------
This patch fixes a very rare example database issue with file permissions.
When running a test that uses both :func:`@given <hypothesis.given>`
and ``pytest.mark.parametrize``, using :pypi:`pytest-xdist` on Windows,
with failing examples in the database, two attempts to read a file could
overlap and we caught ``FileNotFound`` but not other ``OSError``\ s.
.. _v4.23.8:
-------------------
4.23.8 - 2019-05-26
-------------------
This patch has a minor cleanup of the internal engine.
There is no user-visible impact.
.. _v4.23.7:
-------------------
4.23.7 - 2019-05-26
-------------------
This patch clarifies some error messages when the test function signature
is incompatible with the arguments to :func:`@given <hypothesis.given>`,
especially when the :obj:`@settings() <hypothesis.settings>` decorator
is also used (:issue:`1978`).
.. _v4.23.6:
-------------------
4.23.6 - 2019-05-19
-------------------
This release adds the :pypi:`pyupgrade` fixer to our code style,
for consistent use of dict and set literals and comprehensions.
.. _v4.23.5:
-------------------
4.23.5 - 2019-05-16
-------------------
This release slightly simplifies a small part of the core engine.
There is no user-visible change.
.. _v4.23.4:
-------------------
4.23.4 - 2019-05-09
-------------------
Fixes a minor formatting issue the docstring of :func:`~hypothesis.strategies.from_type`
.. _v4.23.3:
-------------------
4.23.3 - 2019-05-09
-------------------
Adds a recipe to the docstring of :func:`~hypothesis.strategies.from_type`
that describes a means for drawing values for "everything except" a specified type.
This recipe is especially useful for writing tests that perform input-type validation.
.. _v4.23.2:
-------------------
4.23.2 - 2019-05-08
-------------------
This patch uses :pypi:`autoflake` to remove some pointless ``pass`` statements,
which improves our workflow but has no user-visible impact.
.. _v4.23.1:
-------------------
4.23.1 - 2019-05-08
-------------------
This patch fixes an OverflowError in
:func:`from_type(xrange) <hypothesis.strategies.from_type>` on Python 2.
It turns out that not only do the ``start`` and ``stop`` values have to
fit in a C long, but so does ``stop - start``. We now handle this even
on 32bit platforms, but remind users that Python2 will not be supported
after 2019 without specific funding.
.. _v4.23.0:
-------------------
4.23.0 - 2019-05-08
-------------------
This release implements the :func:`~hypothesis.strategies.slices` strategy,
to generate slices of a length-``size`` sequence.
Thanks to Daniel J. West for writing this patch at the PyCon 2019 sprints!
.. _v4.22.3:
-------------------
4.22.3 - 2019-05-07
-------------------
This patch exposes :class:`~hypothesis.strategies.DataObject`, *solely*
to support more precise type hints. Objects of this type are provided
by :func:`~hypothesis.strategies.data`, and can be used to draw examples
from strategies intermixed with your test code.
.. _v4.22.2:
-------------------
4.22.2 - 2019-05-07
-------------------
This patch fixes the very rare :issue:`1798` in
:func:`~hypothesis.extra.numpy.array_dtypes`,
which caused an internal error in our tests.
.. _v4.22.1:
-------------------
4.22.1 - 2019-05-07
-------------------
This patch fixes a rare bug in :func:`from_type(range) <hypothesis.strategies.from_type>`.
Thanks to Zebulun Arendsee for fixing the bug at the PyCon 2019 Sprints.
.. _v4.22.0:
-------------------
4.22.0 - 2019-05-07
-------------------
The ``unique_by`` argument to :obj:`~hypothesis.strategies.lists` now accepts a
tuple of callables such that every element of the generated list will be unique
with respect to each callable in the tuple (:issue:`1916`).
Thanks to Marco Sirabella for this feature at the PyCon 2019 sprints!
.. _v4.21.1:
-------------------
4.21.1 - 2019-05-06
-------------------
This patch cleans up the internals of :func:`~hypothesis.strategies.one_of`.
You may see a slight change to the distribution of examples from this strategy
but there is no change to the public API.
Thanks to Marco Sirabella for writing this patch at the PyCon 2019 sprints!
.. _v4.21.0:
-------------------
4.21.0 - 2019-05-05
-------------------
The :func:`~hypothesis.strategies.from_type` strategy now supports
:class:`python:slice` objects.
Thanks to Charlie El. Awbery for writing this feature at the
`PyCon 2019 Mentored Sprints <https://us.pycon.org/2019/hatchery/mentoredsprints/>`__.
.. _v4.20.0:
-------------------
4.20.0 - 2019-05-05
-------------------
This release improves the :func:`~hypothesis.extra.numpy.array_shapes`
strategy, to choose an appropriate default for ``max_side`` based on the
``min_side``, and ``max_dims`` based on the ``min_dims``. An explicit
error is raised for dimensions greater than 32, which are not supported
by Numpy, as for other invalid combinations of arguments.
Thanks to Jenny Rouleau for writing this feature at the
`PyCon 2019 Mentored Sprints <https://us.pycon.org/2019/hatchery/mentoredsprints/>`__.
.. _v4.19.0:
-------------------
4.19.0 - 2019-05-05
-------------------
The :func:`~hypothesis.strategies.from_type` strategy now supports
:class:`python:range` objects (or ``xrange`` on Python 2).
Thanks to Katrina Durance for writing this feature at the
`PyCon 2019 Mentored Sprints <https://us.pycon.org/2019/hatchery/mentoredsprints/>`__.
.. _v4.18.3:
-------------------
4.18.3 - 2019-04-30
-------------------
This release fixes a very rare edge case in the test-case mutator,
which could cause an internal error with certain unusual tests.
.. _v4.18.2:
-------------------
4.18.2 - 2019-04-30
-------------------
This patch makes Hypothesis compatible with the Python 3.8 alpha, which
changed the representation of code objects to support positional-only
arguments. Note however that Hypothesis does not (yet) support such
functions as e.g. arguments to :func:`~hypothesis.strategies.builds`
or inputs to :func:`@given <hypothesis.given>`.
Thanks to Paul Ganssle for identifying and fixing this bug.
.. _v4.18.1:
-------------------
4.18.1 - 2019-04-29
-------------------
This patch improves the performance of unique collections such as
:func:`~hypothesis.strategies.sets` when the elements are drawn from a
:func:`~hypothesis.strategies.sampled_from` strategy (:issue:`1115`).
.. _v4.18.0:
-------------------
4.18.0 - 2019-04-24
-------------------
This release adds the :func:`~hypothesis.strategies.functions` strategy,
which can be used to imitate your 'real' function for callbacks.
.. _v4.17.2:
-------------------
4.17.2 - 2019-04-19
-------------------
This release refactors stateful rule selection to share the new machinery
with :func:`~hypothesis.strategies.sampled_from` instead of using the original
independent implementation.
.. _v4.17.1:
-------------------
4.17.1 - 2019-04-16
-------------------
This patch allows Hypothesis to try a few more examples after finding the
first bug, in hopes of reporting multiple distinct bugs. The heuristics
described in :issue:`847` ensure that we avoid wasting time on fruitless
searches, while still surfacing each bug as soon as possible.
.. _v4.17.0:
-------------------
4.17.0 - 2019-04-16
-------------------
This release adds the strategy :func:`~hypothesis.extra.numpy.broadcastable_shapes`,
which generates array shapes that are `broadcast-compatible <https://www.pythonlikeyoumeanit.com/Module3_IntroducingNumpy/Broadcasting.html#Rules-of-Broadcasting>`_
with a provided shape.
.. _v4.16.0:
-------------------
4.16.0 - 2019-04-12
-------------------
This release allows :func:`~hypothesis.strategies.register_type_strategy` to be used
with :obj:`python:typing.NewType` instances. This may be useful to e.g. provide
only positive integers for :func:`from_type(UserId) <hypothesis.strategies.from_type>`
with a ``UserId = NewType('UserId', int)`` type.
Thanks to PJCampi for suggesting and writing the patch!
.. _v4.15.0:
-------------------
4.15.0 - 2019-04-09
-------------------
This release supports passing a :class:`~python:datetime.timedelta` as the
:obj:`~hypothesis.settings.deadline` setting, so you no longer have to remember
that the number is in milliseconds (:issue:`1900`).
Thanks to Damon Francisco for this change!
.. _v4.14.7:
-------------------
4.14.7 - 2019-04-09
-------------------
This patch makes the type annotations on ``hypothesis.extra.dateutil``
compatible with :pypi:`mypy` 0.700.
.. _v4.14.6:
-------------------
4.14.6 - 2019-04-07
-------------------
This release fixes a bug introduced in :ref:`Hypothesis 4.14.3 <v4.14.3>`
that would sometimes cause
:func:`sampled_from(...).filter(...) <hypothesis.strategies.sampled_from>`
to encounter an internal assertion failure when there are three or fewer
elements, and every element is rejected by the filter.
.. _v4.14.5:
-------------------
4.14.5 - 2019-04-05
-------------------
This patch takes the previous efficiency improvements to
:func:`sampled_from(...).filter(...) <hypothesis.strategies.sampled_from>`
strategies that reject most elements, and generalises them to also apply to
``sampled_from(...).filter(...).filter(...)`` and longer chains of filters.
.. _v4.14.4:
-------------------
4.14.4 - 2019-04-05
-------------------
This release fixes a bug that prevented
:func:`~hypothesis.strategies.random_module`
from correctly restoring the previous state of the ``random`` module.
The random state was instead being restored to a temporary deterministic
state, which accidentally caused subsequent tests to see the same random values
across multiple test runs.
.. _v4.14.3:
-------------------
4.14.3 - 2019-04-03
-------------------
This patch adds an internal special case to make
:func:`sampled_from(...).filter(...) <hypothesis.strategies.sampled_from>`
much more efficient when the filter rejects most elements (:issue:`1885`).
.. _v4.14.2:
-------------------
4.14.2 - 2019-03-31
-------------------
This patch improves the error message if the function ``f`` in
:func:`s.flatmap(f) <hypothesis.strategies.SearchStrategy.flatmap>` does not return a strategy.
Thanks to Kai Chen for this change!
.. _v4.14.1:
-------------------
4.14.1 - 2019-03-30
-------------------
This release modifies how Hypothesis selects operations to run during shrinking,
by causing it to deprioritise previously useless classes of shrink until others have reached a fixed point.
This avoids certain pathological cases where the shrinker gets very close to finishing and then takes a very long time to finish the last small changes because it tries many useless shrinks for each useful one towards the end.
It also should cause a more modest improvement (probably no more than about 30%) in shrinking performance for most tests.
.. _v4.14.0:
-------------------
4.14.0 - 2019-03-19
-------------------
This release blocks installation of Hypothesis on Python 3.4, which
:PEP:`reached its end of life date on 2019-03-18 <429>`.
This should not be of interest to anyone but downstream maintainers -
if you are affected, migrate to a secure version of Python as soon as
possible or at least seek commercial support.
.. _v4.13.0:
-------------------
4.13.0 - 2019-03-19
-------------------
This release makes it an explicit error to call
:func:`floats(min_value=inf, exclude_min=True) <hypothesis.strategies.floats>` or
:func:`floats(max_value=-inf, exclude_max=True) <hypothesis.strategies.floats>`,
as there are no possible values that can be generated (:issue:`1859`).
:func:`floats(min_value=0.0, max_value=-0.0) <hypothesis.strategies.floats>`
is now deprecated. While ``0. == -0.`` and we could thus generate either if
comparing by value, violating the sequence ordering of floats is a special
case we don't want or need.
.. _v4.12.1:
-------------------
4.12.1 - 2019-03-18
-------------------
This release should significantly reduce the amount of memory that Hypothesis uses for representing large test cases,
by storing information in a more compact representation and only unpacking it lazily when it is first needed.
.. _v4.12.0:
-------------------
4.12.0 - 2019-03-18
-------------------
This update adds the :obj:`~hypothesis.settings.report_multiple_bugs` setting,
which you can use to disable multi-bug reporting and only raise whichever bug
had the smallest minimal example. This is occasionally useful when using a
debugger or tools that annotate tracebacks via introspection.
.. _v4.11.7:
-------------------
4.11.7 - 2019-03-18
-------------------
This change makes a tiny improvement to the core engine's bookkeeping.
There is no user-visible change.
.. _v4.11.6:
-------------------
4.11.6 - 2019-03-15
-------------------
This release changes some of Hypothesis's internal shrinking behaviour in order to reduce memory usage and hopefully improve performance.
.. _v4.11.5:
-------------------
4.11.5 - 2019-03-13
-------------------
This release adds a micro-optimisation to how Hypothesis handles debug reporting internally.
Hard to shrink test may see a slight performance improvement, but in most common scenarios it is unlikely to be noticeable.
.. _v4.11.4:
-------------------
4.11.4 - 2019-03-13
-------------------
This release removes some redundant code that was no longer needed but was still running a significant amount of computation and allocation on the hot path.
This should result in a modest speed improvement for most tests, especially those with large test cases.
.. _v4.11.3:
-------------------
4.11.3 - 2019-03-13
-------------------
This release adds a micro-optimisation to how Hypothesis caches test cases.
This will cause a small improvement in speed and memory usage for large test cases,
but in most common scenarios it is unlikely to be noticeable.
.. _v4.11.2:
-------------------
4.11.2 - 2019-03-13
-------------------
This release removes some internal code that populates a field that is no longer used anywhere.
This should result in some modest performance and speed improvements and no other user visible effects.
.. _v4.11.1:
-------------------
4.11.1 - 2019-03-13
-------------------
This is a formatting-only patch, enabled by a new version of :pypi:`isort`.
.. _v4.11.0:
-------------------
4.11.0 - 2019-03-12
-------------------
This release deprecates :func:`~hypothesis.strategies.sampled_from` with empty
sequences. This returns :func:`~hypothesis.strategies.nothing`, which gives a
clear error if used directly... but simply vanishes if combined with another
strategy.
Tests that silently generate less than expected are a serious problem for
anyone relying on them to find bugs, and we think reliability more important
than convenience in this case.
.. _v4.10.0:
-------------------
4.10.0 - 2019-03-11
-------------------
This release improves Hypothesis's to detect flaky tests, by noticing when the behaviour of the test changes between runs.
In particular this will notice many new cases where data generation depends on external state (e.g. external sources of randomness) and flag those as flaky sooner and more reliably.
The basis of this feature is a considerable reengineering of how Hypothesis stores its history of test cases,
so on top of this its memory usage should be considerably reduced.
.. _v4.9.0:
------------------
4.9.0 - 2019-03-09
------------------
This release adds the strategy :func:`~hypothesis.extra.numpy.valid_tuple_axes`,
which generates tuples of axis-indices that can be passed to the ``axis`` argument
in NumPy's sequential functions (e.g. :func:`numpy:numpy.sum`).
Thanks to Ryan Soklaski for this strategy.
.. _v4.8.0:
------------------
4.8.0 - 2019-03-06
------------------
This release significantly tightens validation in :class:`hypothesis.settings`.
:obj:`~hypothesis.settings.max_examples`, ``buffer_size``,
and :obj:`~hypothesis.settings.stateful_step_count` must be positive integers;
:obj:`~hypothesis.settings.deadline` must be a positive number or ``None``; and
:obj:`~hypothesis.settings.derandomize` must be either ``True`` or ``False``.
As usual, this replaces existing errors with a more helpful error and starts new
validation checks as deprecation warnings.
.. _v4.7.19:
-------------------
4.7.19 - 2019-03-04
-------------------
This release makes some micro-optimisations to certain calculations performed in the shrinker.
These should particularly speed up large test cases where the shrinker makes many small changes.
It will also reduce the amount allocated, but most of this is garbage that would have been immediately thrown away,
so you probably won't see much effect specifically from that.
.. _v4.7.18:
-------------------
4.7.18 - 2019-03-03
-------------------
This patch removes some overhead from :func:`~hypothesis.extra.numpy.arrays`
with a constant shape and dtype. The resulting performance improvement is
modest, but worthwhile for small arrays.
.. _v4.7.17:
-------------------
4.7.17 - 2019-03-01
-------------------
This release makes some micro-optimisations within Hypothesis's internal representation of test cases.
This should cause heavily nested test cases to allocate less during generation and shrinking,
which should speed things up slightly.
.. _v4.7.16:
-------------------
4.7.16 - 2019-02-28
-------------------
This changes the order in which Hypothesis runs certain operations during shrinking.
This should significantly decrease memory usage and speed up shrinking of large examples.
.. _v4.7.15:
-------------------
4.7.15 - 2019-02-28
-------------------
This release allows Hypothesis to calculate a number of attributes of generated test cases lazily.
This should significantly reduce memory usage and modestly improve performance,
especially for large test cases.
.. _v4.7.14:
-------------------
4.7.14 - 2019-02-28
-------------------
This release reduces the number of operations the shrinker will try when reordering parts of a test case.
This should in some circumstances significantly speed up shrinking. It *may* result in different final test cases,
and if so usually slightly worse ones, but it should not generally have much impact on the end result as the operations removed were typically useless.
.. _v4.7.13:
-------------------
4.7.13 - 2019-02-27
-------------------
This release changes how Hypothesis reorders examples within a test case during shrinking.
This should make shrinking considerably faster.
.. _v4.7.12:
-------------------
4.7.12 - 2019-02-27
-------------------
This release slightly improves the shrinker's ability to replace parts of a test case with their minimal version,
by allowing it to do so in bulk rather than one at a time. Where this is effective, shrinker performance should be modestly improved.
.. _v4.7.11:
-------------------
4.7.11 - 2019-02-25
-------------------
This release makes some micro-optimisations to common operations performed during shrinking.
Shrinking should now be slightly faster, especially for large examples with relatively fast test functions.
.. _v4.7.10:
-------------------
4.7.10 - 2019-02-25
-------------------
This release is a purely internal refactoring of Hypothesis's API for representing test cases.
There should be no user visible effect.
.. _v4.7.9:
------------------
4.7.9 - 2019-02-24
------------------
This release changes certain shrink passes to make them more efficient when
they aren't making progress.
.. _v4.7.8:
------------------
4.7.8 - 2019-02-23
------------------
This patch removes some unused code, which makes the internals
a bit easier to understand. There is no user-visible impact.
.. _v4.7.7:
------------------
4.7.7 - 2019-02-23
------------------
This release reduces the number of operations the shrinker will try when reordering parts of a test case.
This should in some circumstances significantly speed up shrinking. It *may* result in different final test cases,
and if so usually slightly worse ones, but it should not generally have much impact on the end result as the operations removed were typically useless.
.. _v4.7.6:
------------------
4.7.6 - 2019-02-23
------------------
This patch removes some unused code from the shrinker.
There is no user-visible change.
.. _v4.7.5:
------------------
4.7.5 - 2019-02-23
------------------
This release changes certain shrink passes to make them *adaptive* - that is,
in cases where they are successfully making progress they may now do so significantly
faster.
.. _v4.7.4:
------------------
4.7.4 - 2019-02-22
------------------
This is a docs-only patch, noting that because the :pypi:`lark-parser` is under active
development at version 0.x, ``hypothesis[lark]`` APIs may break in minor
releases if necessary to keep up with the upstream package.
.. _v4.7.3:
------------------
4.7.3 - 2019-02-22
------------------
This changes Hypothesis to no longer import various test frameworks by default (if they are installed).
which will speed up the initial ``import hypothesis`` call.
.. _v4.7.2:
------------------
4.7.2 - 2019-02-22
------------------
This release changes Hypothesis's internal representation of a test case to calculate some expensive structural information on demand rather than eagerly.
This should reduce memory usage a fair bit, and may make generation somewhat faster.
.. _v4.7.1:
------------------
4.7.1 - 2019-02-21
------------------
This release refactors the internal representation of previously run test cases.
The main thing you should see as a result is that Hypothesis becomes somewhat less memory hungry.
.. _v4.7.0:
------------------
4.7.0 - 2019-02-21
------------------
This patch allows :func:`~hypothesis.extra.numpy.array_shapes` to generate shapes
with side-length or even dimension zero, though the minimum still defaults to
one. These shapes are rare and have some odd behavior, but are particularly
important to test for just that reason!
In a related bigfix, :func:`~hypothesis.extra.numpy.arrays` now supports generating
zero-dimensional arrays with ``dtype=object`` and a strategy for iterable elements.
Previously, the array element would incorrectly be set to the first item in the
generated iterable.
Thanks to Ryan Turner for continuing to improve our Numpy support.
.. _v4.6.1:
------------------
4.6.1 - 2019-02-19
------------------
This release is a trivial micro-optimisation inside Hypothesis which should result in it using significantly less memory.
.. _v4.6.0:
------------------
4.6.0 - 2019-02-18
------------------
This release changes some inconsistent behavior of :func:`~hypothesis.extra.numpy.arrays`
from the Numpy extra when asked for an array of ``shape=()``.
:func:`~hypothesis.extra.numpy.arrays` will now always return a Numpy
:class:`~numpy:numpy.ndarray`, and the array will always be of the requested dtype.
Thanks to Ryan Turner for this change.
.. _v4.5.12:
-------------------
4.5.12 - 2019-02-18
-------------------
This release fixes a minor typo in an internal comment. There is no user-visible change.
.. _v4.5.11:
-------------------
4.5.11 - 2019-02-15
-------------------
This release fixes :issue:`1813`, a bug introduced in :ref:`3.59.1 <v3.59.1>`,
which caused :py:meth:`~hypothesis.strategies.random_module` to no longer affect the body of the test:
Although Hypothesis would claim to be seeding the random module in fact tests would always run with a seed of zero.
.. _v4.5.10:
-------------------
4.5.10 - 2019-02-14
-------------------
This patch fixes an off-by-one error in the maximum length of :func:`~hypothesis.strategies.emails`.
Thanks to Krzysztof Jurewicz for :pull:`1812`.
.. _v4.5.9:
------------------
4.5.9 - 2019-02-14
------------------
This patch removes some unused code from the shrinker.
There is no user-visible change.
.. _v4.5.8:
------------------
4.5.8 - 2019-02-12
------------------
This release fixes an internal ``IndexError`` in Hypothesis that could sometimes be triggered during shrinking.
.. _v4.5.7:
------------------
4.5.7 - 2019-02-11
------------------
This release modifies the shrinker to interleave different types of reduction operations,
e.g. switching between deleting data and lowering scalar values rather than trying entirely deletions then entirely lowering.
This may slow things down somewhat in the typical case, but has the major advantage that many previously difficult to shrink examples should become much faster,
because the shrinker will no longer tend to stall when trying some ineffective changes to the shrink target but will instead interleave it with other more effective operations.
.. _v4.5.6:
------------------
4.5.6 - 2019-02-11
------------------
This release makes a number of internal changes to the implementation of :func:`hypothesis.extra.lark.from_lark`.
These are primarily intended as a refactoring, but you may see some minor improvements to performance when generating large strings,
and possibly to shrink quality.
.. _v4.5.5:
------------------
4.5.5 - 2019-02-10
------------------
This patch prints an explanatory note when :issue:`1798` is triggered,
because the error message from Numpy is too terse to locate the problem.
.. _v4.5.4:
------------------
4.5.4 - 2019-02-08
------------------
In Python 2, ``long`` integers are not allowed in the shape argument to
:func:`~hypothesis.extra.numpy.arrays`. Thanks to Ryan Turner for fixing this.
.. _v4.5.3:
------------------
4.5.3 - 2019-02-08
------------------
This release makes a small internal refactoring to clarify how Hypothesis
instructs tests to stop running when appropriate. There is no user-visible
change.
.. _v4.5.2:
------------------
4.5.2 - 2019-02-06
------------------
This release standardises all of the shrinker's internal operations on running in a random order.
The main effect you will see from this that it should now be much less common for the shrinker to stall for a long time before making further progress.
In some cases this will correspond to shrinking more slowly, but on average it should result in faster shrinking.
.. _v4.5.1:
------------------
4.5.1 - 2019-02-05
------------------
This patch updates some docstrings, but has no runtime changes.
.. _v4.5.0:
------------------
4.5.0 - 2019-02-03
------------------
This release adds ``exclude_min`` and ``exclude_max`` arguments to
:func:`~hypothesis.strategies.floats`, so that you can easily generate values from
:wikipedia:`open or half-open intervals <Interval_(mathematics)>`
(:issue:`1622`).
.. _v4.4.6:
------------------
4.4.6 - 2019-02-03
------------------
This patch fixes a bug where :func:`~hypothesis.strategies.from_regex`
could throw an internal error if the :obj:`python:re.IGNORECASE` flag
was used (:issue:`1786`).
.. _v4.4.5:
------------------
4.4.5 - 2019-02-02
------------------
This release removes two shrink passes that Hypothesis runs late in the process.
These were very expensive when the test function was slow and often didn't do anything useful.
Shrinking should get faster for most failing tests.
If you see any regression in example quality as a result of this release, please let us know.
.. _v4.4.4:
------------------
4.4.4 - 2019-02-02
------------------
This release modifies the way that Hypothesis deletes data during shrinking.
It will primarily be noticeable for very large examples, which should now shrink faster.
The shrinker is now also able to perform some deletions that it could not previously,
but this is unlikely to be very noticeable.
.. _v4.4.3:
------------------
4.4.3 - 2019-01-25
------------------
This release fixes an open file leak that used to cause ``ResourceWarning``\ s.
.. _v4.4.2:
------------------
4.4.2 - 2019-01-24
------------------
This release changes Hypothesis's internal approach to caching the results of executing test cases.
The result should be that it is now significantly less memory hungry, especially when shrinking large test cases.
Some tests may get slower or faster depending on whether the new or old caching strategy was well suited to them,
but any change in speed in either direction should be minor.
.. _v4.4.1:
------------------
4.4.1 - 2019-01-24
------------------
This patch tightens up some of our internal heuristics to deal with shrinking floating point numbers,
which will now run in fewer circumstances.
You are fairly unlikely to see much difference from this, but if you do you are likely to see shrinking become slightly faster and/or producing slightly worse results.
.. _v4.4.0:
------------------
4.4.0 - 2019-01-24
------------------
This release adds the :func:`~hypothesis.extra.django.from_form` function, which allows automatic testing against Django forms. (:issue:`35`)
Thanks to Paul Stiverson for this feature, which resolves our oldest open issue!
.. _v4.3.0:
------------------
4.3.0 - 2019-01-24
------------------
This release deprecates ``HealthCheck.hung_test`` and disables the
associated runtime check for tests that ran for more than five minutes.
Such a check is redundant now that we enforce the ``deadline`` and
``max_examples`` setting, which can be adjusted independently.
.. _v4.2.0:
------------------
4.2.0 - 2019-01-23
------------------
This release adds a new module, ``hypothesis.extra.lark``, which you
can use to generate strings matching a context-free grammar.
In this initial version, only :pypi:`lark-parser` EBNF grammars are supported,
by the new :func:`hypothesis.extra.lark.from_lark` function.
.. _v4.1.2:
------------------
4.1.2 - 2019-01-23
------------------
This patch fixes a very rare overflow bug (:issue:`1748`) which could raise an
``InvalidArgument`` error in :func:`~hypothesis.strategies.complex_numbers`
even though the arguments were valid.
.. _v4.1.1:
------------------
4.1.1 - 2019-01-23
------------------
This release makes some improvements to internal code organisation and documentation and has no impact on behaviour.
.. _v4.1.0:
------------------
4.1.0 - 2019-01-22
------------------
This release adds :func:`~hypothesis.register_random`, which registers
``random.Random`` instances or compatible objects to be seeded and reset
by Hypothesis to ensure that test cases are deterministic.
We still recommend explicitly passing a ``random.Random`` instance from
:func:`~hypothesis.strategies.randoms` if possible, but registering a
framework-global state for Hypothesis to manage is better than flaky tests!
.. _v4.0.2:
------------------
4.0.2 - 2019-01-22
------------------
This patch fixes :issue:`1387`, where bounded :func:`~hypothesis.strategies.integers`
with a very large range would almost always generate very large numbers.
Now, we usually use the same tuned distribution as unbounded
:func:`~hypothesis.strategies.integers`.
.. _v4.0.1:
------------------
4.0.1 - 2019-01-16
------------------
This release randomizes the order in which the shrinker tries some of its initial normalization operations.
You are unlikely to see much difference as a result unless your generated examples are very large.
In this case you may see some performance improvements in shrinking.
.. _v4.0.0:
------------------
4.0.0 - 2019-01-14
------------------
Welcome to the next major version of Hypothesis!
There are no new features here, as we release those in minor versions.
Instead, 4.0 is a chance for us to remove deprecated features (many already
converted into no-ops), and turn a variety of warnings into errors.
If you were running on the last version of Hypothesis 3.x *without any
Hypothesis deprecation warnings* (or using private APIs), this will be
a very boring upgrade. **In fact, nothing will change for you at all.**
Per :ref:`our deprecation policy <deprecation-policy>`, warnings added in
the last six months (after 2018-07-05) have not been converted to errors.
Removals
~~~~~~~~
- ``hypothesis.extra.datetime`` has been removed, replaced by the core
date and time strategies.
- ``hypothesis.extra.fakefactory`` has been removed, replaced by general
expansion of Hypothesis' strategies and the third-party ecosystem.
- The SQLite example database backend has been removed.
Settings
~~~~~~~~
- The :obj:`~hypothesis.settings.deadline` is now enforced by default, rather than just
emitting a warning when the default (200 milliseconds per test case) deadline is exceeded.
- The ``database_file`` setting has been removed; use :obj:`~hypothesis.settings.database`.
- The ``perform_health_check`` setting has been removed; use
:obj:`~hypothesis.settings.suppress_health_check`.
- The ``max_shrinks`` setting has been removed; use :obj:`~hypothesis.settings.phases`
to disable shrinking.
- The ``min_satisfying_examples``, ``max_iterations``, ``strict``, ``timeout``, and
``use_coverage`` settings have been removed without user-configurable replacements.
Strategies
~~~~~~~~~~
- The ``elements`` argument is now required for collection strategies.
- The ``average_size`` argument was a no-op and has been removed.
- Date and time strategies now only accept ``min_value`` and ``max_value`` for bounds.
- :func:`~hypothesis.strategies.builds` now requires that the thing to build is
passed as the first positional argument.
- Alphabet validation for :func:`~hypothesis.strategies.text` raises errors, not warnings,
as does category validation for :func:`~hypothesis.strategies.characters`.
- The ``choices()`` strategy has been removed. Instead, you can use
:func:`~hypothesis.strategies.data` with :func:`~hypothesis.strategies.sampled_from`,
so ``choice(elements)`` becomes ``data.draw(sampled_from(elements))``.
- The ``streaming()`` strategy has been removed. Instead, you can use
:func:`~hypothesis.strategies.data` and replace iterating over the stream with
``data.draw()`` calls.
- :func:`~hypothesis.strategies.sampled_from` and :func:`~hypothesis.strategies.permutations`
raise errors instead of warnings if passed a collection that is not a sequence.
Miscellaneous
~~~~~~~~~~~~~
- Applying :func:`@given <hypothesis.given>` to a test function multiple times
was really inefficient, and now it's also an error.
- Using the ``.example()`` method of a strategy (intended for interactive
exploration) within another strategy or a test function always weakened
data generation and broke shrinking, and now it's an error too.
- The ``HYPOTHESIS_DATABASE_FILE`` environment variable is no longer
supported, as the ``database_file`` setting has been removed.
- The ``HYPOTHESIS_VERBOSITY_LEVEL`` environment variable is no longer
supported. You can use the ``--hypothesis-verbosity`` pytest argument instead,
or write your own setup code using the settings profile system to replace it.
- Using :func:`@seed <hypothesis.seed>` or
:obj:`derandomize=True <hypothesis.settings.derandomize>` now forces
:obj:`database=None <hypothesis.settings.database>` to ensure results
are in fact reproducible. If :obj:`~hypothesis.settings.database` is
*not* ``None``, doing so also emits a ``HypothesisWarning``.
- Unused exception types have been removed from ``hypothesis.errors``;
namely ``AbnormalExit``, ``BadData``, ``BadTemplateDraw``,
``DefinitelyNoSuchExample``, ``Timeout``, and ``WrongFormat``.
Hypothesis 3.x
==============
.. _v3.88.3:
-------------------
3.88.3 - 2019-01-11
-------------------
This changes the order that the shrinker tries certain operations in its "emergency" phase which runs late in the process.
The new order should be better at avoiding long stalls where the shrinker is failing to make progress,
which may be helpful if you have difficult to shrink test cases.
However this will not be noticeable in the vast majority of use cases.
.. _v3.88.2:
-------------------
3.88.2 - 2019-01-11
-------------------
This is a pure refactoring release that extracts some logic from the core Hypothesis engine
into its own class and file. It should have no user visible impact.
.. _v3.88.1:
-------------------
3.88.1 - 2019-01-11
-------------------
This patch fixes some markup in our documentation.
.. _v3.88.0:
-------------------
3.88.0 - 2019-01-10
-------------------
Introduces :func:`hypothesis.stateful.multiple`, which allows rules in rule
based state machines to send multiple results at once to their target Bundle,
or none at all.
.. _v3.87.0:
-------------------
3.87.0 - 2019-01-10
-------------------
This release contains a massive cleanup of the Hypothesis for Django extra:
- ``hypothesis.extra.django.models.models()`` is deprecated in favor of
:func:`hypothesis.extra.django.from_model`.
- ``hypothesis.extra.django.models.add_default_field_mapping()`` is deprecated
in favor of :func:`hypothesis.extra.django.register_field_strategy`.
- :func:`~hypothesis.extra.django.from_model` does not infer a strategy for
nullable fields or fields with a default unless passed ``infer``, like
:func:`~hypothesis.strategies.builds`.
``models.models()`` would usually but not always infer, and a special
``default_value`` marker object was required to disable inference.
.. _v3.86.9:
-------------------
3.86.9 - 2019-01-09
-------------------
This release improves some internal logic about when a test case in Hypothesis's internal representation could lead to a valid test case.
In some circumstances this can lead to a significant speed up during shrinking.
It may have some minor negative impact on the quality of the final result due to certain shrink passes now having access to less information about test cases in some circumstances, but this should rarely matter.
.. _v3.86.8:
-------------------
3.86.8 - 2019-01-09
-------------------
This release has no user visible changes but updates our URLs to use HTTPS.
.. _v3.86.7:
-------------------
3.86.7 - 2019-01-08
-------------------
Hypothesis can now automatically generate values for Django models with a
`~django.db.models.URLField`, thanks to a new provisional strategy for URLs (:issue:`1388`).
.. _v3.86.6:
-------------------
3.86.6 - 2019-01-07
-------------------
This release is a pure refactoring that extracts some internal code into its own file.
It should have no user visible effect.
.. _v3.86.5:
-------------------
3.86.5 - 2019-01-06
-------------------
This is a docs-only patch, which fixes some typos and removes a few hyperlinks
for deprecated features.
.. _v3.86.4:
-------------------
3.86.4 - 2019-01-04
-------------------
This release changes the order in which the shrinker tries to delete data.
For large and slow tests this may significantly improve the performance of shrinking.
.. _v3.86.3:
-------------------
3.86.3 - 2019-01-04
-------------------
This release fixes a bug where certain places Hypothesis internal errors could be
raised during shrinking when a user exception occurred that suppressed an exception
Hypothesis uses internally in its generation.
The two known ways to trigger this problem were:
* Errors raised in stateful tests' teardown function.
* Errors raised in finally blocks that wrapped a call to ``data.draw``.
These cases will now be handled correctly.
.. _v3.86.2:
-------------------
3.86.2 - 2019-01-04
-------------------
This patch is a docs-only change to fix a broken hyperlink.
.. _v3.86.1:
-------------------
3.86.1 - 2019-01-04
-------------------
This patch fixes :issue:`1732`, where :func:`~hypothesis.strategies.integers`
would always return ``long`` values on Python 2.
.. _v3.86.0:
-------------------
3.86.0 - 2019-01-03
-------------------
This release ensures that infinite numbers are never generated by
:func:`~hypothesis.strategies.floats` with ``allow_infinity=False``,
which could previously happen in some cases where one bound was also
provided.
The trivially inconsistent ``min_value=inf, allow_infinity=False`` now
raises an InvalidArgumentError, as does the inverse with ``max_value``.
You can still use :func:`just(inf) <hypothesis.strategies.just>` to
generate ``inf`` without violating other constraints.
.. _v3.85.3:
-------------------
3.85.3 - 2019-01-02
-------------------
Happy new year everyone!
This release has no user visible changes but updates our copyright headers to include 2019.
.. _v3.85.2:
-------------------
3.85.2 - 2018-12-31
-------------------
This release makes a small change to the way the shrinker works.
You may see some improvements to speed of shrinking on especially large and hard to shrink examples,
but most users are unlikely to see much difference.
.. _v3.85.1:
-------------------
3.85.1 - 2018-12-30
-------------------
This patch fixes :issue:`1700`, where a line that contained a Unicode character
before a lambda definition would cause an internal exception.
.. _v3.85.0:
-------------------
3.85.0 - 2018-12-29
-------------------
Introduces the :func:`hypothesis.stateful.consumes` function. When defining
a rule in stateful testing, it can be used to mark bundles from which values
should be consumed, i. e. removed after use in the rule. This has been
proposed in :issue:`136`.
Thanks to Jochen Müller for this long-awaited feature.
.. _v3.84.6:
-------------------
3.84.6 - 2018-12-28
-------------------
This patch makes a small internal change to fix an issue in Hypothesis's
own coverage tests (:issue:`1718`).
There is no user-visible change.
.. _v3.84.5:
-------------------
3.84.5 - 2018-12-21
-------------------
This patch refactors the ``hypothesis.strategies`` module, so that private
names should no longer appear in tab-completion lists. We previously relied
on ``__all__`` for this, but not all editors respect it.
.. _v3.84.4:
-------------------
3.84.4 - 2018-12-21
-------------------
This is a follow-up patch to ensure that the deprecation date is automatically
recorded for any new deprecations. There is no user-visible effect.
.. _v3.84.3:
-------------------
3.84.3 - 2018-12-20
-------------------
This patch updates the Hypothesis pytest plugin to avoid a recently
deprecated hook interface. There is no user-visible change.
.. _v3.84.2:
-------------------
3.84.2 - 2018-12-19
-------------------
This patch fixes the internals for :func:`~hypothesis.strategies.integers`
with one bound. Values from this strategy now always shrink towards zero
instead of towards the bound, and should shrink much more efficiently too.
On Python 2, providing a bound incorrectly excluded ``long`` integers,
which can now be generated.
.. _v3.84.1:
-------------------
3.84.1 - 2018-12-18
-------------------
This patch adds information about when features were deprecated, but this
is only recorded internally and has no user-visible effect.
.. _v3.84.0:
-------------------
3.84.0 - 2018-12-18
-------------------
This release changes the stateful testing backend from
``find()`` to use :func:`@given <hypothesis.given>`
(:issue:`1300`). This doesn't change how you create stateful tests,
but does make them run more like other Hypothesis tests.
:func:`@reproduce_failure <hypothesis.reproduce_failure>` and
:func:`@seed <hypothesis.seed>` now work for stateful tests.
Stateful tests now respect the :attr:`~hypothesis.settings.deadline`
and :attr:`~hypothesis.settings.suppress_health_check` settings,
though they are disabled by default. You can enable them by using
:func:`@settings(...) <hypothesis.settings>` as a class decorator
with whatever arguments you prefer.
.. _v3.83.2:
-------------------
3.83.2 - 2018-12-17
-------------------
Hypothesis has adopted :pypi:`black` as our code formatter (:issue:`1686`).
There are no functional changes to the source, but it's prettier!
.. _v3.83.1:
-------------------
3.83.1 - 2018-12-13
-------------------
This patch increases the variety of examples generated by
:func:`~hypothesis.strategies.from_type`.
.. _v3.83.0:
-------------------
3.83.0 - 2018-12-12
-------------------
Our pytest plugin now warns you when strategy functions have been collected
as tests, which may happen when e.g. using the
:func:`@composite <hypothesis.strategies.composite>` decorator when you
should be using ``@given(st.data())`` for inline draws.
Such functions *always* pass when treated as tests, because the lazy creation
of strategies mean that the function body is never actually executed!
.. _v3.82.6:
-------------------
3.82.6 - 2018-12-11
-------------------
Hypothesis can now :ref:`show statistics <statistics>` when running
under :pypi:`pytest-xdist`. Previously, statistics were only reported
when all tests were run in a single process (:issue:`700`).
.. _v3.82.5:
-------------------
3.82.5 - 2018-12-08
-------------------
This patch fixes :issue:`1667`, where passing bounds of Numpy
dtype ``int64`` to :func:`~hypothesis.strategies.integers` could
cause errors on Python 3 due to internal rounding.
.. _v3.82.4:
-------------------
3.82.4 - 2018-12-08
-------------------
Hypothesis now seeds and resets the global state of
:mod:`np.random <numpy:numpy.random>` for each
test case, to ensure that tests are reproducible.
This matches and complements the existing handling of the
:mod:`python:random` module - Numpy simply maintains an
independent PRNG for performance reasons.
.. _v3.82.3:
-------------------
3.82.3 - 2018-12-08
-------------------
This is a no-op release to add the new ``Framework :: Hypothesis``
`trove classifier <https://pypi.org/classifiers/>`_ to
:pypi:`hypothesis` on PyPI.
You can `use it as a filter <https://pypi.org/search/?c=Framework+%3A%3A+Hypothesis>`_
to find Hypothesis-related packages such as extensions as they add the tag
over the coming weeks, or simply visit :doc:`our curated list <reference/strategies>`.
.. _v3.82.2:
-------------------
3.82.2 - 2018-12-08
-------------------
The :ref:`Hypothesis for Pandas extension <hypothesis-pandas>` is now
listed in ``setup.py``, so you can ``pip install hypothesis[pandas]``.
Thanks to jmshi for this contribution.
.. _v3.82.1:
-------------------
3.82.1 - 2018-10-29
-------------------
This patch fixes :func:`~hypothesis.strategies.from_type` on Python 2
for classes where ``cls.__init__ is object.__init__``.
Thanks to ccxcz for reporting :issue:`1656`.
.. _v3.82.0:
-------------------
3.82.0 - 2018-10-29
-------------------
The ``alphabet`` argument for :func:`~hypothesis.strategies.text` now
uses its default value of ``characters(exclude_categories=('Cs',))``
directly, instead of hiding that behind ``alphabet=None`` and replacing
it within the function. Passing ``None`` is therefore deprecated.
.. _v3.81.0:
-------------------
3.81.0 - 2018-10-27
-------------------
``GenericStateMachine`` and
:class:`~hypothesis.stateful.RuleBasedStateMachine` now raise an explicit error
when instances of :obj:`~hypothesis.settings` are assigned to the classes'
settings attribute, which is a no-op (:issue:`1643`). Instead assign to
``SomeStateMachine.TestCase.settings``, or use ``@settings(...)`` as a class
decorator to handle this automatically.
.. _v3.80.0:
-------------------
3.80.0 - 2018-10-25
-------------------
Since :ref:`version 3.68.0 <v3.68.0>`, :func:`~hypothesis.extra.numpy.arrays`
checks that values drawn from the ``elements`` and ``fill`` strategies can be
safely cast to the dtype of the array, and emits a warning otherwise.
This release expands the checks to cover overflow for finite ``complex64``
elements and string truncation caused by too-long elements or trailing null
characters (:issue:`1591`).
.. _v3.79.4:
-------------------
3.79.4 - 2018-10-25
-------------------
Tests using :func:`@given <hypothesis.given>` now shrink errors raised from
:pypi:`pytest` helper functions, instead of reporting the first example found.
This was previously fixed in :ref:`version 3.56.0 <v3.56.0>`, but only for
stateful testing.
.. _v3.79.3:
-------------------
3.79.3 - 2018-10-23
-------------------
Traceback elision is now disabled on Python 2, to avoid an import-time
:class:`python:SyntaxError` under Python < 2.7.9 (Python: :bpo:`21591`,
:ref:`Hypothesis 3.79.2 <v3.79.2>`: :issue:`1648`).
We encourage all users to `upgrade to Python 3 before the end of 2019
<https://pythonclock.org/>`_.
.. _v3.79.2:
-------------------
3.79.2 - 2018-10-23
-------------------
This patch shortens tracebacks from Hypothesis, so you can see exactly
happened in your code without having to skip over irrelevant details
about our internals (:issue:`848`).
In the example test (see :pull:`1582`), this reduces tracebacks from
nine frames to just three - and for a test with multiple errors, from
seven frames per error to just one!
If you *do* want to see the internal details, you can disable frame
elision by setting :obj:`~hypothesis.settings.verbosity` to ``debug``.
.. _v3.79.1:
-------------------
3.79.1 - 2018-10-22
-------------------
The abstract number classes :class:`~python:numbers.Number`,
:class:`~python:numbers.Complex`, :class:`~python:numbers.Real`,
:class:`~python:numbers.Rational`, and :class:`~python:numbers.Integral`
are now supported by the :func:`~hypothesis.strategies.from_type`
strategy. Previously, you would have to use
:func:`~hypothesis.strategies.register_type_strategy` before they
could be resolved (:issue:`1636`)
.. _v3.79.0:
-------------------
3.79.0 - 2018-10-18
-------------------
This release adds a CLI flag for verbosity ``--hypothesis-verbosity`` to
the Hypothesis pytest plugin, applied after loading the profile specified by
``--hypothesis-profile``. Valid options are the names of verbosity settings,
quiet, normal, verbose or debug.
Thanks to Bex Dunn for writing this patch at the PyCon Australia
sprints!
The pytest header now correctly reports the current profile if
``--hypothesis-profile`` has been used.
Thanks to Mathieu Paturel for the contribution at the Canberra Python
Hacktoberfest.
.. _v3.78.0:
-------------------
3.78.0 - 2018-10-16
-------------------
This release has deprecated the generation of integers, floats and fractions
when the conversion of the upper and/ or lower bound is not 100% exact, e.g.
when an integer gets passed a bound that is not a whole number. (:issue:`1625`)
Thanks to Felix Grünewald for this patch during Hacktoberfest 2018.
.. _v3.77.0:
-------------------
3.77.0 - 2018-10-16
-------------------
This minor release adds functionality to :obj:`~hypothesis.settings` allowing
it to be used as a decorator on :obj:`~hypothesis.stateful.RuleBasedStateMachine`
and ``GenericStateMachine``.
Thanks to Tyler Nickerson for this feature in #hacktoberfest!
.. _v3.76.1:
-------------------
3.76.1 - 2018-10-16
-------------------
This patch fixes some warnings added by recent releases of
:pypi:`pydocstyle` and :pypi:`mypy`.
.. _v3.76.0:
-------------------
3.76.0 - 2018-10-11
-------------------
This release deprecates using floats for ``min_size`` and ``max_size``.
The type hint for ``average_size`` arguments has been changed from
``Optional[int]`` to None, because non-None values are always ignored and
deprecated.
.. _v3.75.4:
-------------------
3.75.4 - 2018-10-10
-------------------
This patch adds more internal comments to the core engine's sequence-length
shrinker. There should be no user-visible change.
.. _v3.75.3:
-------------------
3.75.3 - 2018-10-09
-------------------
This patch adds additional comments to some of the core engine's internal
data structures. There is no user-visible change.
.. _v3.75.2:
-------------------
3.75.2 - 2018-10-09
-------------------
This patch avoids caching a trivial case, fixing :issue:`493`.
.. _v3.75.1:
-------------------
3.75.1 - 2018-10-09
-------------------
This patch fixes a broken link in a docstring.
Thanks to Benjamin Lee for this contribution!
.. _v3.75.0:
-------------------
3.75.0 - 2018-10-08
-------------------
This release deprecates the use of ``min_size=None``, setting the default
``min_size`` to 0 (:issue:`1618`).
.. _v3.74.3:
-------------------
3.74.3 - 2018-10-08
-------------------
This patch makes some small internal changes to comply with a new lint setting
in the build. There should be no user-visible change.
.. _v3.74.2:
-------------------
3.74.2 - 2018-10-03
-------------------
This patch fixes :issue:`1153`, where time spent reifying a strategy was
also counted in the time spent generating the first example. Strategies
are now fully constructed and validated before the timer is started.
.. _v3.74.1:
-------------------
3.74.1 - 2018-10-03
-------------------
This patch fixes some broken formatting and links in the documentation.
.. _v3.74.0:
-------------------
3.74.0 - 2018-10-01
-------------------
This release checks that the value of the
:attr:`~hypothesis.settings.print_blob` setting is a
``PrintSettings`` instance.
Being able to specify a boolean value was not intended, and is now deprecated.
In addition, specifying ``True`` will now cause the blob to always be printed,
instead of causing it to be suppressed.
Specifying any value that is not a ``PrintSettings``
or a boolean is now an error.
.. _v3.73.5:
-------------------
3.73.5 - 2018-10-01
-------------------
Changes the documentation for ``hypothesis.strategies.datetimes``, ``hypothesis.strategies.dates``, ``hypothesis.strategies.times`` to use the new parameter names ``min_value`` and ``max_value`` instead of the deprecated names
.. _v3.73.4:
-------------------
3.73.4 - 2018-09-30
-------------------
This patch ensures that Hypothesis deprecation warnings display the code
that emitted them when you're not running in ``-Werror`` mode (:issue:`652`).
.. _v3.73.3:
-------------------
3.73.3 - 2018-09-27
-------------------
Tracebacks involving :func:`@composite <hypothesis.strategies.composite>`
are now slightly shorter due to some internal refactoring.
.. _v3.73.2:
-------------------
3.73.2 - 2018-09-26
-------------------
This patch fixes errors in the internal comments for one of the shrinker
passes. There is no user-visible change.
.. _v3.73.1:
-------------------
3.73.1 - 2018-09-25
-------------------
This patch substantially improves the distribution of data generated
with :func:`~hypothesis.strategies.recursive`, and fixes a rare internal
error (:issue:`1502`).
.. _v3.73.0:
-------------------
3.73.0 - 2018-09-24
-------------------
This release adds the :func:`~hypothesis.extra.dpcontracts.fulfill` function,
which is designed for testing code that uses :pypi:`dpcontracts` 0.4 or later
for input validation. This provides some syntactic sugar around use of
:func:`~hypothesis.assume`, to automatically filter out and retry calls that
cause a precondition check to fail (:issue:`1474`).
.. _v3.72.0:
-------------------
3.72.0 - 2018-09-24
-------------------
This release makes setting attributes of the :class:`hypothesis.settings`
class an explicit error. This has never had any effect, but could mislead
users who confused it with the current settings *instance*
``hypothesis.settings.default`` (which is also immutable). You can change
the global settings with |settings.register_profile|.
.. _v3.71.11:
--------------------
3.71.11 - 2018-09-24
--------------------
This patch factors out some common code in the shrinker for iterating
over pairs of data blocks. There should be no user-visible change.
.. _v3.71.10:
--------------------
3.71.10 - 2018-09-18
--------------------
This patch allows :func:`~hypothesis.strategies.from_type` to handle the
empty tuple type, :obj:`typing.Tuple[()] <python:typing.Tuple>`.
.. _v3.71.9:
-------------------
3.71.9 - 2018-09-17
-------------------
This patch updates some internal comments for :pypi:`mypy`.
There is no user-visible effect, even for Mypy users.
.. _v3.71.8:
-------------------
3.71.8 - 2018-09-17
-------------------
This patch fixes a rare bug that would cause a particular shrinker pass to
raise an IndexError, if a shrink improvement changed the underlying data
in an unexpected way.
.. _v3.71.7:
-------------------
3.71.7 - 2018-09-17
-------------------
This release fixes the broken cross-references in our docs,
and adds a CI check so we don't add new ones.
.. _v3.71.6:
-------------------
3.71.6 - 2018-09-16
-------------------
This patch fixes two bugs (:issue:`944` and :issue:`1521`), where messages
about :func:`@seed <hypothesis.seed>` did not check the current verbosity
setting, and the wrong settings were active while executing
explicit examples from |@example|.
.. _v3.71.5:
-------------------
3.71.5 - 2018-09-15
-------------------
This patch fixes a ``DeprecationWarning`` added in Python 3.8 (:issue:`1576`).
Thanks to tirkarthi for this contribution!
.. _v3.71.4:
-------------------
3.71.4 - 2018-09-14
-------------------
This is a no-op release, which implements automatic DOI minting and code
archival of Hypothesis via `Zenodo <https://zenodo.org/>`_. Thanks to
CERN and the EU *Horizon 2020* programme for providing this service!
Check our :gh-file:`CITATION.cff` file for details, or head right on over to
`doi.org/10.5281/zenodo.1412597 <https://doi.org/10.5281/zenodo.1412597>`_
.. _v3.71.3:
-------------------
3.71.3 - 2018-09-10
-------------------
This release adds the test name to some deprecation warnings,
for easier debugging.
Thanks to Sanyam Khurana for the patch!
.. _v3.71.2:
-------------------
3.71.2 - 2018-09-10
-------------------
This release makes Hypothesis's memory usage substantially smaller for tests with many
examples, by bounding the number of past examples it keeps around.
You will not see much difference unless you are running tests with :obj:`~hypothesis.settings.max_examples`
set to well over ``1000``, but if you do have such tests then you should see memory usage mostly plateau
where previously it would have grown linearly with time.
.. _v3.71.1:
-------------------
3.71.1 - 2018-09-09
-------------------
This patch adds internal comments to some tree traversals in the core engine.
There is no user-visible change.
.. _v3.71.0:
-------------------
3.71.0 - 2018-09-08
-------------------
This release deprecates the coverage-guided testing functionality,
as it has proven brittle and does not really pull its weight.
We intend to replace it with something more useful in the future,
but the feature in its current form does not seem to be worth the cost of using,
and whatever replaces it will likely look very different.
.. _v3.70.4:
-------------------
3.70.4 - 2018-09-08
-------------------
This patch changes the behaviour of :func:`~hypothesis.reproduce_failure`
so that blobs are only printed in quiet mode when the
:obj:`~hypothesis.settings.print_blob` setting is set to ``ALWAYS``.
Thanks to Cameron McGill for writing this patch at the PyCon Australia sprints!
.. _v3.70.3:
-------------------
3.70.3 - 2018-09-03
-------------------
This patch removes some unnecessary code from the internals.
There is no user-visible change.
.. _v3.70.2:
-------------------
3.70.2 - 2018-09-03
-------------------
This patch fixes an internal bug where a corrupted argument to
:func:`@reproduce_failure <hypothesis.reproduce_failure>` could raise
the wrong type of error. Thanks again to Paweł T. Jochym, who maintains
Hypothesis on `conda-forge <https://conda-forge.org/>`_ and consistently
provides excellent bug reports including :issue:`1558`.
.. _v3.70.1:
-------------------
3.70.1 - 2018-09-03
-------------------
This patch updates hypothesis to report its version and settings when run with
pytest. (:issue:`1223`).
Thanks to Jack Massey for this feature.
.. _v3.70.0:
-------------------
3.70.0 - 2018-09-01
-------------------
This release adds a ``fullmatch`` argument to
:func:`~hypothesis.strategies.from_regex`. When ``fullmatch=True``, the
whole example will match the regex pattern as for :func:`python:re.fullmatch`.
Thanks to Jakub Nabaglo for writing this patch at the PyCon Australia sprints!
.. _v3.69.12:
--------------------
3.69.12 - 2018-08-30
--------------------
This release reverts the changes to logging handling in 3.69.11,
which broke test that use the :pypi:`pytest` ``caplog`` fixture
internally because all logging was disabled (:issue:`1546`).
.. _v3.69.11:
--------------------
3.69.11 - 2018-08-29
--------------------
This patch will hide all logging messages produced by test cases before the
final, minimal, failing test case (:issue:`356`).
Thanks to Gary Donovan for writing this patch at the PyCon Australia sprints!
.. _v3.69.10:
--------------------
3.69.10 - 2018-08-29
--------------------
This patch fixes a bug that prevents coverage from reporting unexecuted
Python files (:issue:`1085`).
Thanks to Gary Donovan for writing this patch at the PyCon Australia sprints!
.. _v3.69.9:
-------------------
3.69.9 - 2018-08-28
-------------------
This patch improves the packaging of the Python package by adding
``LICENSE.txt`` to the sdist (:issue:`1311`), clarifying the minimum
supported versions of :pypi:`pytz` and :pypi:`dateutil <python-dateutil>`
(:issue:`1383`), and adds keywords to the metadata (:issue:`1520`).
Thanks to Graham Williamson for writing this patch at the PyCon
Australia sprints!
.. _v3.69.8:
-------------------
3.69.8 - 2018-08-28
-------------------
This is an internal change which replaces pickle with json to prevent possible
security issues.
Thanks to Vidya Rani D G for writing this patch at the PyCon Australia sprints!
.. _v3.69.7:
-------------------
3.69.7 - 2018-08-28
-------------------
This patch ensures that :func:`~hypothesis.note` prints the note for every
test case when the :obj:`~hypothesis.settings.verbosity` setting is
``Verbosity.verbose``. At normal verbosity it only prints from the final
test case.
Thanks to Tom McDermott for writing this patch at
the PyCon Australia sprints!
.. _v3.69.6:
-------------------
3.69.6 - 2018-08-27
-------------------
This patch improves the testing of some internal caching. It should have
no user-visible effect.
.. _v3.69.5:
-------------------
3.69.5 - 2018-08-27
-------------------
This change performs a small rename and refactoring in the core engine.
There is no user-visible change.
.. _v3.69.4:
-------------------
3.69.4 - 2018-08-27
-------------------
This change improves the core engine's ability to avoid unnecessary work,
by consulting its cache of previously-tried inputs in more cases.
.. _v3.69.3:
-------------------
3.69.3 - 2018-08-27
-------------------
This patch handles passing an empty :class:`python:enum.Enum` to
:func:`~hypothesis.strategies.from_type` by returning
:func:`~hypothesis.strategies.nothing`, instead of raising an
internal :class:`python:AssertionError`.
Thanks to Paul Amazona for writing this patch at the
PyCon Australia sprints!
.. _v3.69.2:
-------------------
3.69.2 - 2018-08-23
-------------------
This patch fixes a small mistake in an internal comment.
There is no user-visible change.
.. _v3.69.1:
-------------------
3.69.1 - 2018-08-21
-------------------
This change fixes a small bug in how the core engine consults its cache
of previously-tried inputs. There is unlikely to be any user-visible change.
.. _v3.69.0:
-------------------
3.69.0 - 2018-08-20
-------------------
This release improves argument validation for stateful testing.
- If the target or targets of a :func:`~hypothesis.stateful.rule` are invalid,
we now raise a useful validation error rather than an internal exception.
- Passing both the ``target`` and ``targets`` arguments is deprecated -
append the ``target`` bundle to the ``targets`` tuple of bundles instead.
- Passing the name of a Bundle rather than the Bundle itself is also deprecated.
.. _v3.68.3:
-------------------
3.68.3 - 2018-08-20
-------------------
This is a docs-only patch, fixing some typos and formatting issues.
.. _v3.68.2:
-------------------
3.68.2 - 2018-08-19
-------------------
This change fixes a small bug in how the core engine caches the results of
previously-tried inputs. The effect is unlikely to be noticeable, but it might
avoid unnecessary work in some cases.
.. _v3.68.1:
-------------------
3.68.1 - 2018-08-18
-------------------
This patch documents the :func:`~hypothesis.extra.numpy.from_dtype` function,
which infers a strategy for :class:`numpy:numpy.dtype`\ s. This is used in
:func:`~hypothesis.extra.numpy.arrays`, but can also be used directly when
creating e.g. Pandas objects.
.. _v3.68.0:
-------------------
3.68.0 - 2018-08-15
-------------------
:func:`~hypothesis.extra.numpy.arrays` now checks that integer and float
values drawn from ``elements`` and ``fill`` strategies can be safely cast
to the dtype of the array, and emits a warning otherwise (:issue:`1385`).
Elements in the resulting array could previously violate constraints on
the elements strategy due to floating-point overflow or truncation of
integers to fit smaller types.
.. _v3.67.1:
-------------------
3.67.1 - 2018-08-14
-------------------
This release contains a tiny refactoring of the internals.
There is no user-visible change.
.. _v3.67.0:
-------------------
3.67.0 - 2018-08-10
-------------------
This release adds a ``width`` argument to :func:`~hypothesis.strategies.floats`,
to generate lower-precision floating point numbers for e.g. Numpy arrays.
The generated examples are always instances of Python's native ``float``
type, which is 64bit, but passing ``width=32`` will ensure that all values
can be exactly represented as 32bit floats. This can be useful to avoid
overflow (to +/- infinity), and for efficiency of generation and shrinking.
Half-precision floats (``width=16``) are also supported, but require Numpy
if you are running Python 3.5 or earlier.
.. _v3.66.33:
--------------------
3.66.33 - 2018-08-10
--------------------
This release fixes a bug in :func:`~hypothesis.strategies.floats`, where
setting ``allow_infinity=False`` and exactly one of ``min_value`` and
``max_value`` would allow infinite values to be generated.
.. _v3.66.32:
--------------------
3.66.32 - 2018-08-09
--------------------
This release adds type hints to the :obj:`@example() <hypothesis.example>` and
:func:`~hypothesis.seed` decorators, and fixes the type hint on
:func:`~hypothesis.strategies.register_type_strategy`. The second argument to
:func:`~hypothesis.strategies.register_type_strategy` must either be a
``SearchStrategy``, or a callable which takes a ``type`` and returns a
``SearchStrategy``.
.. _v3.66.31:
--------------------
3.66.31 - 2018-08-08
--------------------
Another set of changes designed to improve the performance of shrinking on
large examples. In particular the shrinker should now spend considerably less
time running useless shrinks.
.. _v3.66.30:
--------------------
3.66.30 - 2018-08-06
--------------------
"Bug fixes and performance improvements".
This release is a fairly major overhaul of the shrinker designed to improve
its behaviour on large examples, especially around stateful testing. You
should hopefully see shrinking become much faster, with little to no quality
degradation (in some cases quality may even improve).
.. _v3.66.29:
--------------------
3.66.29 - 2018-08-05
--------------------
This release fixes two very minor bugs in the core engine:
* it fixes a corner case that was missing in :ref:`3.66.28 <v3.66.28>`, which
should cause shrinking to work slightly better.
* it fixes some logic for how shrinking interacts with the database that was
causing Hypothesis to be insufficiently aggressive about clearing out old
keys.
.. _v3.66.28:
--------------------
3.66.28 - 2018-08-05
--------------------
This release improves how Hypothesis handles reducing the size of integers'
representation. This change should mostly be invisible as it's purely about
the underlying representation and not the generated value, but it may result
in some improvements to shrink performance.
.. _v3.66.27:
--------------------
3.66.27 - 2018-08-05
--------------------
This release changes the order in which Hypothesis chooses parts of the test case
to shrink. For typical usage this should be a significant performance improvement on
large examples. It is unlikely to have a major impact on example quality, but where
it does change the result it should usually be an improvement.
.. _v3.66.26:
--------------------
3.66.26 - 2018-08-05
--------------------
This release improves the debugging information that the shrinker emits about
the operations it performs, giving better summary statistics about which
passes resulted in test executions and whether they were successful.
.. _v3.66.25:
--------------------
3.66.25 - 2018-08-05
--------------------
This release fixes several bugs that were introduced to the shrinker in
:ref:`3.66.24 <v3.66.24>` which would have caused it to behave significantly
less well than advertised. With any luck you should *actually* see the promised
benefits now.
.. _v3.66.24:
--------------------
3.66.24 - 2018-08-03
--------------------
This release changes how Hypothesis deletes data when shrinking in order to
better handle deletion of large numbers of contiguous sequences. Most tests
should see little change, but this will hopefully provide a significant
speed up for :ref:`stateful testing <stateful>`.
.. _v3.66.23:
--------------------
3.66.23 - 2018-08-02
--------------------
This release makes some internal changes to enable further improvements to the
shrinker. You may see some changes in the final shrunk examples, but they are
unlikely to be significant.
.. _v3.66.22:
--------------------
3.66.22 - 2018-08-01
--------------------
This release adds some more internal caching to the shrinker. This should cause
a significant speed up for shrinking, especially for stateful testing and
large example sizes.
.. _v3.66.21:
--------------------
3.66.21 - 2018-08-01
--------------------
This patch is for downstream packagers - our tests now pass under
:pypi:`pytest` 3.7.0 (released 2018-07-30). There are no changes
to the source of Hypothesis itself.
.. _v3.66.20:
--------------------
3.66.20 - 2018-08-01
--------------------
This release removes some functionality from the shrinker that was taking a
considerable amount of time and does not appear to be useful any more due to
a number of quality improvements in the shrinker.
You may see some degradation in shrink quality as a result of this, but mostly
shrinking should just get much faster.
.. _v3.66.19:
--------------------
3.66.19 - 2018-08-01
--------------------
This release slightly changes the format of some debugging information emitted
during shrinking, and refactors some of the internal interfaces around that.
.. _v3.66.18:
--------------------
3.66.18 - 2018-07-31
--------------------
This release is a very small internal refactoring which should have no user
visible impact.
.. _v3.66.17:
--------------------
3.66.17 - 2018-07-31
--------------------
This release fixes a bug that could cause an ``IndexError`` to be raised from
inside Hypothesis during shrinking. It is likely that it was impossible to
trigger this bug in practice - it was only made visible by some currently
unreleased work.
.. _v3.66.16:
--------------------
3.66.16 - 2018-07-31
--------------------
This release is a very small internal refactoring which should have no user
visible impact.
.. _v3.66.15:
--------------------
3.66.15 - 2018-07-31
--------------------
This release makes Hypothesis's shrinking faster by removing some redundant
work that it does when minimizing values in its internal representation.
.. _v3.66.14:
--------------------
3.66.14 - 2018-07-30
--------------------
This release expands the deprecation of timeout from :ref:`3.16.0 <v3.16.0>` to
also emit the deprecation warning in ``find`` or :ref:`stateful testing <stateful>`.
.. _v3.66.13:
--------------------
3.66.13 - 2018-07-30
--------------------
This release adds an additional shrink pass that is able to reduce the size of
examples in some cases where the transformation is non-obvious. In particular
this will improve the quality of some examples which would have regressed in
:ref:`3.66.12 <v3.66.12>`.
.. _v3.66.12:
--------------------
3.66.12 - 2018-07-28
--------------------
This release changes how we group data together for shrinking. It should result
in improved shrinker performance, especially in stateful testing.
.. _v3.66.11:
--------------------
3.66.11 - 2018-07-28
--------------------
This patch modifies how which rule to run is selected during
:ref:`rule based stateful testing <stateful>`. This should result in a slight
performance increase during generation and a significant performance and
quality improvement when shrinking.
As a result of this change, some state machines which would previously have
thrown an ``InvalidDefinition`` are no longer detected as invalid.
.. _v3.66.10:
--------------------
3.66.10 - 2018-07-28
--------------------
This release weakens some minor functionality in the shrinker that had only
modest benefit and made its behaviour much harder to reason about.
This is unlikely to have much user visible effect, but it is possible that in
some cases shrinking may get slightly slower. It is primarily to make it easier
to work on the shrinker and pave the way for future work.
.. _v3.66.9:
-------------------
3.66.9 - 2018-07-26
-------------------
This release improves the information that Hypothesis emits about its shrinking
when :obj:`~hypothesis.settings.verbosity` is set to debug.
.. _v3.66.8:
-------------------
3.66.8 - 2018-07-24
-------------------
This patch includes some minor fixes in the documentation, and updates
the minimum version of :pypi:`pytest` to 3.0 (released August 2016).
.. _v3.66.7:
-------------------
3.66.7 - 2018-07-24
-------------------
This release fixes a bug where difficult to shrink tests could sometimes
trigger an internal assertion error inside the shrinker.
.. _v3.66.6:
-------------------
3.66.6 - 2018-07-23
-------------------
This patch ensures that Hypothesis fully supports Python 3.7, by
upgrading :func:`~hypothesis.strategies.from_type` (:issue:`1264`)
and fixing some minor issues in our test suite (:issue:`1148`).
.. _v3.66.5:
-------------------
3.66.5 - 2018-07-22
-------------------
This patch fixes the online docs for various extras, by ensuring that
their dependencies are installed on readthedocs.io (:issue:`1326`).
.. _v3.66.4:
-------------------
3.66.4 - 2018-07-20
-------------------
This release improves the shrinker's ability to reorder examples.
For example, consider the following test:
.. code-block:: python
import hypothesis.strategies as st
from hypothesis import given
@given(st.text(), st.text())
def test_non_equal(x, y):
assert x != y
Previously this could have failed with either of ``x="", y="0"`` or
``x="0", y=""``. Now it should always fail with ``x="", y="0"``.
This will allow the shrinker to produce more consistent results, especially in
cases where test cases contain some ordered collection whose actual order does
not matter.
.. _v3.66.3:
-------------------
3.66.3 - 2018-07-20
-------------------
This patch fixes inference in the :func:`~hypothesis.strategies.builds`
strategy with subtypes of :class:`python:typing.NamedTuple`, where the
``__init__`` method is not useful for introspection. We now use the
field types instead - thanks to James Uther for identifying this bug.
.. _v3.66.2:
-------------------
3.66.2 - 2018-07-19
-------------------
This release improves the shrinker's ability to handle situations where there
is an additive constraint between two values.
For example, consider the following test:
.. code-block:: python
import hypothesis.strategies as st
from hypothesis import given
@given(st.integers(), st.integers())
def test_does_not_exceed_100(m, n):
assert m + n < 100
Previously this could have failed with almost any pair ``(m, n)`` with
``0 <= m <= n`` and ``m + n == 100``. Now it should almost always fail with
``m=0, n=100``.
This is a relatively niche specialisation, but can be useful in situations
where e.g. a bug is triggered by an integer overflow.
.. _v3.66.1:
-------------------
3.66.1 - 2018-07-09
-------------------
This patch fixes a rare bug where an incorrect percentage drawtime
could be displayed for a test, when the system clock was changed during
a test running under Python 2 (we use :func:`python:time.monotonic`
where it is available to avoid such problems). It also fixes a possible
zero-division error that can occur when the underlying C library
double-rounds an intermediate value in :func:`python:math.fsum` and
gets the least significant bit wrong.
.. _v3.66.0:
-------------------
3.66.0 - 2018-07-05
-------------------
This release improves validation of the ``alphabet`` argument to the
:func:`~hypothesis.strategies.text` strategy. The following misuses
are now deprecated, and will be an error in a future version:
- passing an unordered collection (such as ``set('abc')``), which
violates invariants about shrinking and reproducibility
- passing an alphabet sequence with elements that are not strings
- passing an alphabet sequence with elements that are not of length one,
which violates any size constraints that may apply
Thanks to Sushobhit for adding these warnings (:issue:`1329`).
.. _v3.65.3:
-------------------
3.65.3 - 2018-07-04
-------------------
This release fixes a mostly theoretical bug where certain usage of the internal
API could trigger an assertion error inside Hypothesis. It is unlikely that
this problem is even possible to trigger through the public API.
.. _v3.65.2:
-------------------
3.65.2 - 2018-07-04
-------------------
This release fixes dependency information for coverage. Previously Hypothesis
would allow installing :pypi:`coverage` with any version, but it only works
with coverage 4.0 or later.
We now specify the correct metadata in our ``setup.py``, so Hypothesis will
only allow installation with compatible versions of coverage.
.. _v3.65.1:
-------------------
3.65.1 - 2018-07-03
-------------------
This patch ensures that :ref:`stateful tests <stateful>` which raise an
error from a :pypi:`pytest` helper still print the sequence of steps
taken to reach that point (:issue:`1372`). This reporting was previously
broken because the helpers inherit directly from :class:`python:BaseException`, and
therefore require special handling to catch without breaking e.g. the use
of ctrl-C to quit the test.
.. _v3.65.0:
-------------------
3.65.0 - 2018-06-30
-------------------
This release deprecates the ``max_shrinks`` setting
in favor of an internal heuristic. If you need to avoid shrinking examples,
use the :obj:`~hypothesis.settings.phases` setting instead. (:issue:`1235`)
.. _v3.64.2:
-------------------
3.64.2 - 2018-06-27
-------------------
This release fixes a bug where an internal assertion error could sometimes be
triggered while shrinking a failing test.
.. _v3.64.1:
-------------------
3.64.1 - 2018-06-27
-------------------
This patch fixes type-checking errors in our vendored pretty-printer,
which were ignored by our mypy config but visible for anyone else
(whoops). Thanks to Pi Delport for reporting :issue:`1359` so promptly.
.. _v3.64.0:
-------------------
3.64.0 - 2018-06-26
-------------------
This release adds :ref:`an interface <custom-function-execution>`
which can be used to insert a wrapper between the original test function and
:func:`@given <hypothesis.given>` (:issue:`1257`). This will be particularly
useful for test runner extensions such as :pypi:`pytest-trio`, but is
not recommended for direct use by other users of Hypothesis.
.. _v3.63.0:
-------------------
3.63.0 - 2018-06-26
-------------------
This release adds a new mechanism to infer strategies for classes
defined using :pypi:`attrs`, based on the the type, converter, or
validator of each attribute. This inference is now built in to
:func:`~hypothesis.strategies.builds` and :func:`~hypothesis.strategies.from_type`.
On Python 2, :func:`~hypothesis.strategies.from_type` no longer generates
instances of ``int`` when passed ``long``, or vice-versa.
.. _v3.62.0:
-------------------
3.62.0 - 2018-06-26
-------------------
This release adds :PEP:`484` type hints to Hypothesis on a provisional
basis, using the comment-based syntax for Python 2 compatibility.
It *also* adds the ``py.typed`` marker specified in :PEP:`561`.
After you ``pip install hypothesis``, :pypi:`mypy` 0.590 or later
will therefore type-check your use of our public interface!
.. _v3.61.0:
-------------------
3.61.0 - 2018-06-24
-------------------
This release deprecates the use of :class:`~hypothesis.settings` as a
context manager, the use of which is somewhat ambiguous.
Users should define settings with global state or with the
:func:`@settings(...) <hypothesis.settings>` decorator.
.. _v3.60.1:
-------------------
3.60.1 - 2018-06-20
-------------------
Fixed a bug in generating an instance of a Django model from a
strategy where the primary key is generated as part of the
strategy. See :ref:`details here <django-generating-primary-key>`.
Thanks to Tim Martin for this contribution.
.. _v3.60.0:
-------------------
3.60.0 - 2018-06-20
-------------------
This release adds the :func:`@initialize <hypothesis.stateful.initialize>`
decorator for stateful testing (originally discussed in :issue:`1216`).
All :func:`@initialize <hypothesis.stateful.initialize>` rules will be called
once each in an arbitrary order before any normal rule is called.
.. _v3.59.3:
-------------------
3.59.3 - 2018-06-19
-------------------
This is a no-op release to take into account some changes to the release
process. It should have no user visible effect.
.. _v3.59.2:
-------------------
3.59.2 - 2018-06-18
-------------------
This adds support for partially sorting examples which cannot be fully sorted.
For example, [5, 4, 3, 2, 1, 0] with a constraint that the first element needs
to be larger than the last becomes [1, 2, 3, 4, 5, 0].
Thanks to Luke for contributing.
.. _v3.59.1:
-------------------
3.59.1 - 2018-06-16
-------------------
This patch uses :func:`python:random.getstate` and :func:`python:random.setstate`
to restore the PRNG state after :func:`@given <hypothesis.given>` runs
deterministic tests. Without restoring state, you might have noticed problems
such as :issue:`1266`. The fix also applies to stateful testing (:issue:`702`).
.. _v3.59.0:
-------------------
3.59.0 - 2018-06-14
-------------------
This release adds the :func:`~hypothesis.strategies.emails` strategy,
which generates unicode strings representing an email address.
Thanks to Sushobhit for moving this to the public API (:issue:`162`).
.. _v3.58.1:
-------------------
3.58.1 - 2018-06-13
-------------------
This improves the shrinker. It can now reorder examples: 3 1 2 becomes 1 2 3.
Thanks to Luke for contributing.
.. _v3.58.0:
-------------------
3.58.0 - 2018-06-13
-------------------
This adds a new extra :py:func:`~hypothesis.extra.dateutil.timezones` strategy
that generates :pypi:`dateutil timezones <python-dateutil>`.
Thanks to Conrad for contributing.
.. _v3.57.0:
-------------------
3.57.0 - 2018-05-20
-------------------
Using an unordered collection with the :func:`~hypothesis.strategies.permutations`
strategy has been deprecated because the order in which e.g. a set shrinks is
arbitrary. This may cause different results between runs.
.. _v3.56.10:
--------------------
3.56.10 - 2018-05-16
--------------------
This release makes ``hypothesis.settings.define_setting``
a private method, which has the effect of hiding it from the
documentation.
.. _v3.56.9:
-------------------
3.56.9 - 2018-05-11
-------------------
This is another release with no functionality changes as part of changes to
Hypothesis's new release tagging scheme.
.. _v3.56.8:
-------------------
3.56.8 - 2018-05-10
-------------------
This is a release with no functionality changes that moves Hypothesis over to
a new release tagging scheme.
.. _v3.56.7:
-------------------
3.56.7 - 2018-05-10
-------------------
This release provides a performance improvement for most tests, but in
particular users of :func:`~hypothesis.strategies.sampled_from` who don't
have numpy installed should see a significant performance improvement.
.. _v3.56.6:
-------------------
3.56.6 - 2018-05-09
-------------------
This patch contains further internal work to support Mypy.
There are no user-visible changes... yet.
.. _v3.56.5:
-------------------
3.56.5 - 2018-04-22
-------------------
This patch contains some internal refactoring to run :pypi:`mypy` in CI.
There are no user-visible changes.
.. _v3.56.4:
-------------------
3.56.4 - 2018-04-21
-------------------
This release involves some very minor internal clean up and should have no
user visible effect at all.
.. _v3.56.3:
-------------------
3.56.3 - 2018-04-20
-------------------
This release fixes a problem introduced in :ref:`3.56.0 <v3.56.0>` where
setting the hypothesis home directory (through currently undocumented
means) would no longer result in the default database location living
in the new home directory.
.. _v3.56.2:
-------------------
3.56.2 - 2018-04-20
-------------------
This release fixes a problem introduced in :ref:`3.56.0 <v3.56.0>` where
setting :obj:`~hypothesis.settings.max_examples` to ``1`` would result in tests
failing with ``Unsatisfiable``. This problem could also occur in other harder
to trigger circumstances (e.g. by setting it to a low value, having a hard to
satisfy assumption, and disabling health checks).
.. _v3.56.1:
-------------------
3.56.1 - 2018-04-20
-------------------
This release fixes a problem that was introduced in :ref:`3.56.0 <v3.56.0>`:
Use of the ``HYPOTHESIS_VERBOSITY_LEVEL`` environment variable was, rather
than deprecated, actually broken due to being read before various setup
the deprecation path needed was done. It now works correctly (and emits a
deprecation warning).
.. _v3.56.0:
-------------------
3.56.0 - 2018-04-17
-------------------
This release deprecates several redundant or internally oriented
:class:`~hypothesis.settings`, working towards an orthogonal set of
configuration options that are widely useful *without* requiring any
knowledge of our internals (:issue:`535`).
- Deprecated settings that no longer have any effect are no longer
shown in the ``__repr__`` unless set to a non-default value.
- ``hypothesis.settings.perform_health_check`` is deprecated, as it
duplicates :obj:`~hypothesis.settings.suppress_health_check`.
- ``hypothesis.settings.max_iterations`` is deprecated and disabled,
because we can usually get better behaviour from an internal heuristic
than a user-controlled setting.
- ``hypothesis.settings.min_satisfying_examples`` is deprecated and
disabled, due to overlap with the
:obj:`~hypothesis.HealthCheck.filter_too_much` healthcheck
and poor interaction with :obj:`~hypothesis.settings.max_examples`.
- ``HYPOTHESIS_VERBOSITY_LEVEL`` is now deprecated. Set
:obj:`~hypothesis.settings.verbosity` through the profile system instead.
- Examples tried by ``find()`` are now reported at ``debug``
verbosity level (as well as ``verbose`` level).
.. _v3.55.6:
-------------------
3.55.6 - 2018-04-14
-------------------
This release fixes a somewhat obscure condition (:issue:`1230`) under which you
could occasionally see a failing test trigger an assertion error inside
Hypothesis instead of failing normally.
.. _v3.55.5:
-------------------
3.55.5 - 2018-04-14
-------------------
This patch fixes one possible cause of :issue:`966`. When running
Python 2 with hash randomisation, passing a :obj:`python:bytes` object
to :func:`python:random.seed` would use ``version=1``, which broke
:obj:`~hypothesis.settings.derandomize` (because the seed depended on
a randomised hash). If :obj:`~hypothesis.settings.derandomize` is
*still* nondeterministic for you, please open an issue.
.. _v3.55.4:
-------------------
3.55.4 - 2018-04-13
-------------------
This patch makes a variety of minor improvements to the documentation,
and improves a few validation messages for invalid inputs.
.. _v3.55.3:
-------------------
3.55.3 - 2018-04-12
-------------------
This release updates the URL metadata associated with the PyPI package (again).
It has no other user visible effects.
.. _v3.55.2:
-------------------
3.55.2 - 2018-04-11
-------------------
This release updates the URL metadata associated with the PyPI package.
It has no other user visible effects.
.. _v3.55.1:
-------------------
3.55.1 - 2018-04-06
-------------------
This patch relaxes constraints in our tests on the expected values returned
by the standard library function :func:`~python:math.hypot` and the internal
helper function ``cathetus``, to fix near-exact
test failures on some 32-bit systems used by downstream packagers.
.. _v3.55.0:
-------------------
3.55.0 - 2018-04-05
-------------------
This release includes several improvements to the handling of the
:obj:`~hypothesis.settings.database` setting.
- The ``database_file`` setting was a historical
artefact, and you should just use :obj:`~hypothesis.settings.database`
directly.
- The ``HYPOTHESIS_DATABASE_FILE`` environment variable is
deprecated, in favor of :meth:`~hypothesis.settings.load_profile` and
the :obj:`~hypothesis.settings.database` setting.
- If you have not configured the example database at all and the default
location is not usable (due to e.g. permissions issues), Hypothesis
will fall back to an in-memory database. This is not persisted between
sessions, but means that the defaults work on read-only filesystems.
.. _v3.54.0:
-------------------
3.54.0 - 2018-04-04
-------------------
This release improves the :func:`~hypothesis.strategies.complex_numbers`
strategy, which now supports ``min_magnitude`` and ``max_magnitude``
arguments, along with ``allow_nan`` and ``allow_infinity`` like for
:func:`~hypothesis.strategies.floats`.
Thanks to J.J. Green for this feature.
.. _v3.53.0:
-------------------
3.53.0 - 2018-04-01
-------------------
This release removes support for Django 1.8, which reached end of life on
2018-04-01. You can see Django's release and support schedule
`on the Django Project website <https://www.djangoproject.com/download/#supported-versions>`_.
.. _v3.52.3:
-------------------
3.52.3 - 2018-04-01
-------------------
This patch fixes the ``min_satisfying_examples`` settings
documentation, by explaining that example shrinking is tracked at the level
of the underlying bytestream rather than the output value.
The output from ``find()`` in verbose mode has also been
adjusted - see the example session for |Verbosity| - to avoid
duplicating lines when the example repr is constant, even if the underlying
representation has been shrunken.
.. _v3.52.2:
-------------------
3.52.2 - 2018-03-30
-------------------
This release improves the output of failures with
:ref:`rule based stateful testing <stateful>` in two ways:
* The output from it is now usually valid Python code.
* When the same value has two different names because it belongs to two different
bundles, it will now display with the name associated with the correct bundle
for a rule argument where it is used.
.. _v3.52.1:
-------------------
3.52.1 - 2018-03-29
-------------------
This release improves the behaviour of :ref:`stateful testing <stateful>`
in two ways:
* Previously some runs would run no steps (:issue:`376`). This should no longer
happen.
* RuleBasedStateMachine tests which used bundles extensively would often shrink
terribly. This should now be significantly improved, though there is likely
a lot more room for improvement.
This release also involves a low level change to how ranges of integers are
handles which may result in other improvements to shrink quality in some cases.
.. _v3.52.0:
-------------------
3.52.0 - 2018-03-24
-------------------
This release deprecates use of :func:`@settings(...) <hypothesis.settings>`
as a decorator, on functions or methods that are not also decorated with
:func:`@given <hypothesis.given>`. You can still apply these decorators
in any order, though you should only do so once each.
Applying :func:`@given <hypothesis.given>` twice was already deprecated, and
applying :func:`@settings(...) <hypothesis.settings>` twice is deprecated in
this release and will become an error in a future version. Neither could ever
be used twice to good effect.
Using :func:`@settings(...) <hypothesis.settings>` as the sole decorator on
a test is completely pointless, so this common usage error will become an
error in a future version of Hypothesis.
.. _v3.51.0:
-------------------
3.51.0 - 2018-03-24
-------------------
This release deprecates the ``average_size`` argument to
:func:`~hypothesis.strategies.lists` and other collection strategies.
You should simply delete it wherever it was used in your tests, as it
no longer has any effect.
In early versions of Hypothesis, the ``average_size`` argument was treated
as a hint about the distribution of examples from a strategy. Subsequent
improvements to the conceptual model and the engine for generating and
shrinking examples mean it is more effective to simply describe what
constitutes a valid example, and let our internals handle the distribution.
.. _v3.50.3:
-------------------
3.50.3 - 2018-03-24
-------------------
This patch contains some internal refactoring so that we can run
with warnings as errors in CI.
.. _v3.50.2:
-------------------
3.50.2 - 2018-03-20
-------------------
This has no user-visible changes except one slight formatting change to one docstring, to avoid a deprecation warning.
.. _v3.50.1:
-------------------
3.50.1 - 2018-03-20
-------------------
This patch fixes an internal error introduced in :ref:`3.48.0 <v3.48.0>`, where a check
for the Django test runner would expose import-time errors in Django
configuration (:issue:`1167`).
.. _v3.50.0:
-------------------
3.50.0 - 2018-03-19
-------------------
This release improves validation of numeric bounds for some strategies.
- :func:`~hypothesis.strategies.integers` and :func:`~hypothesis.strategies.floats`
now raise ``InvalidArgument`` if passed a ``min_value`` or ``max_value``
which is not an instance of :class:`~python:numbers.Real`, instead of
various internal errors.
- :func:`~hypothesis.strategies.floats` now converts its bounding values to
the nearest float above or below the min or max bound respectively, instead
of just casting to float. The old behaviour was incorrect in that you could
generate ``float(min_value)``, even when this was less than ``min_value``
itself (possible with eg. fractions).
- When both bounds are provided to :func:`~hypothesis.strategies.floats` but
there are no floats in the interval, such as ``[(2**54)+1 .. (2**55)-1]``,
InvalidArgument is raised.
- :func:`~hypothesis.strategies.decimals` gives a more useful error message
if passed a string that cannot be converted to :class:`~python:decimal.Decimal`
in a context where this error is not trapped.
Code that previously **seemed** to work may be explicitly broken if there
were no floats between ``min_value`` and ``max_value`` (only possible with
non-float bounds), or if a bound was not a :class:`~python:numbers.Real`
number but still allowed in :obj:`python:math.isnan` (some custom classes
with a ``__float__`` method).
.. _v3.49.1:
-------------------
3.49.1 - 2018-03-15
-------------------
This patch fixes our tests for Numpy dtype strategies on big-endian platforms,
where the strategy behaved correctly but the test assumed that the native byte
order was little-endian.
There is no user impact unless you are running our test suite on big-endian
platforms. Thanks to Graham Inggs for reporting :issue:`1164`.
.. _v3.49.0:
-------------------
3.49.0 - 2018-03-12
-------------------
This release deprecates passing ``elements=None`` to collection strategies,
such as :func:`~hypothesis.strategies.lists`.
Requiring ``lists(nothing())`` or ``builds(list)`` instead of ``lists()``
means slightly more typing, but also improves the consistency and
discoverability of our API - as well as showing how to compose or
construct strategies in ways that still work in more complex situations.
Passing a nonzero max_size to a collection strategy where the elements
strategy contains no values is now deprecated, and will be an error in a
future version. The equivalent with ``elements=None`` is already an error.
.. _v3.48.1:
-------------------
3.48.1 - 2018-03-05
-------------------
This patch will minimize examples that would come out non-minimal in previous versions. Thanks to Kyle Reeve for this patch.
.. _v3.48.0:
-------------------
3.48.0 - 2018-03-05
-------------------
This release improves some "unhappy paths" when using Hypothesis
with the standard library :mod:`python:unittest` module:
- Applying :func:`@given <hypothesis.given>` to a non-test method which is
overridden from :class:`python:unittest.TestCase`, such as ``setUp``,
raises :attr:`a new health check <hypothesis.HealthCheck.not_a_test_method>`.
(:issue:`991`)
- Using :meth:`~python:unittest.TestCase.subTest` within a test decorated
with :func:`@given <hypothesis.given>` would leak intermediate results
when tests were run under the :mod:`python:unittest` test runner.
Individual reporting of failing subtests is now disabled during a test
using :func:`@given <hypothesis.given>`. (:issue:`1071`)
- :func:`@given <hypothesis.given>` is still not a class decorator, but the
error message if you try using it on a class has been improved.
As a related improvement, using :class:`django:django.test.TestCase` with
:func:`@given <hypothesis.given>` instead of
:class:`hypothesis.extra.django.TestCase` raises an explicit error instead
of running all examples in a single database transaction.
.. _v3.47.0:
-------------------
3.47.0 - 2018-03-02
-------------------
:obj:`~hypothesis.settings.register_profile` now accepts keyword arguments
for specific settings, and the parent settings object is now optional.
Using a ``name`` for a registered profile which is not a string was never
suggested, but it is now also deprecated and will eventually be an error.
.. _v3.46.2:
-------------------
3.46.2 - 2018-03-01
-------------------
This release removes an unnecessary branch from the code, and has no user-visible impact.
.. _v3.46.1:
-------------------
3.46.1 - 2018-03-01
-------------------
This changes only the formatting of our docstrings and should have no user-visible effects.
.. _v3.46.0:
-------------------
3.46.0 - 2018-02-26
-------------------
:func:`~hypothesis.strategies.characters` has improved docs about
what arguments are valid, and additional validation logic to raise a
clear error early (instead of e.g. silently ignoring a bad argument).
Categories may be specified as the Unicode 'general category'
(eg ``'Nd'``), or as the 'major category' (eg ``['N', 'Lu']``
is equivalent to ``['Nd', 'Nl', 'No', 'Lu']``).
In previous versions, general categories were supported and all other
input was silently ignored. Now, major categories are supported in
addition to general categories (which may change the behaviour of some
existing code), and all other input is deprecated.
.. _v3.45.5:
-------------------
3.45.5 - 2018-02-26
-------------------
This patch improves strategy inference in ``hypothesis.extra.django``
to account for some validators in addition to field type - see
:issue:`1116` for ongoing work in this space.
Specifically, if a :class:`~django:django.db.models.CharField` or
:class:`~django:django.db.models.TextField` has an attached
:class:`~django:django.core.validators.RegexValidator`, we now use
:func:`~hypothesis.strategies.from_regex` instead of
:func:`~hypothesis.strategies.text` as the underlying strategy.
This allows us to generate examples of the default
:class:`~django:django.contrib.auth.models.User` model, closing :issue:`1112`.
.. _v3.45.4:
-------------------
3.45.4 - 2018-02-25
-------------------
This patch improves some internal debugging information, fixes
a typo in a validation error message, and expands the documentation
for new contributors.
.. _v3.45.3:
-------------------
3.45.3 - 2018-02-23
-------------------
This patch may improve example shrinking slightly for some strategies.
.. _v3.45.2:
-------------------
3.45.2 - 2018-02-18
-------------------
This release makes our docstring style more consistent, thanks to
:pypi:`flake8-docstrings`. There are no user-visible changes.
.. _v3.45.1:
-------------------
3.45.1 - 2018-02-17
-------------------
This fixes an indentation issue in docstrings for
:func:`~hypothesis.strategies.datetimes`, :func:`~hypothesis.strategies.dates`,
:func:`~hypothesis.strategies.times`, and
:func:`~hypothesis.strategies.timedeltas`.
.. _v3.45.0:
-------------------
3.45.0 - 2018-02-13
-------------------
This release fixes :func:`~hypothesis.strategies.builds` so that ``target``
can be used as a keyword argument for passing values to the target. The target
itself can still be specified as a keyword argument, but that behavior is now
deprecated. The target should be provided as the first positional argument.
.. _v3.44.26:
--------------------
3.44.26 - 2018-02-06
--------------------
This release fixes some formatting issues in the Hypothesis source code.
It should have no externally visible effects.
.. _v3.44.25:
--------------------
3.44.25 - 2018-02-05
--------------------
This release changes the way in which Hypothesis tries to shrink the size of
examples. It probably won't have much impact, but might make shrinking faster
in some cases. It is unlikely but not impossible that it will change the
resulting examples.
.. _v3.44.24:
--------------------
3.44.24 - 2018-01-27
--------------------
This release fixes dependency information when installing Hypothesis
from a binary "wheel" distribution.
- The ``install_requires`` for :pypi:`enum34` is resolved at install
time, rather than at build time (with potentially different results).
- Django has fixed their ``python_requires`` for versions 2.0.0 onward,
simplifying Python2-compatible constraints for downstream projects.
.. _v3.44.23:
--------------------
3.44.23 - 2018-01-24
--------------------
This release improves shrinking in a class of pathological examples that you
are probably never hitting in practice. If you *are* hitting them in practice
this should be a significant speed up in shrinking. If you are not, you are
very unlikely to notice any difference. You might see a slight slow down and/or
slightly better falsifying examples.
.. _v3.44.22:
--------------------
3.44.22 - 2018-01-23
--------------------
This release fixes a dependency problem. It was possible to install
Hypothesis with an old version of :pypi:`attrs`, which would throw a
``TypeError`` as soon as you tried to import hypothesis. Specifically, you
need attrs 16.0.0 or newer.
Hypothesis will now require the correct version of attrs when installing.
.. _v3.44.21:
--------------------
3.44.21 - 2018-01-22
--------------------
This change adds some additional structural information that Hypothesis will
use to guide its search.
You mostly shouldn't see much difference from this. The two most likely effects
you would notice are:
1. Hypothesis stores slightly more examples in its database for passing tests.
2. Hypothesis *may* find new bugs that it was previously missing, but it
probably won't (this is a basic implementation of the feature that is
intended to support future work. Although it is useful on its own, it's not
*very* useful on its own).
.. _v3.44.20:
--------------------
3.44.20 - 2018-01-21
--------------------
This is a small refactoring release that changes how Hypothesis tracks some
information about the boundary of examples in its internal representation.
You are unlikely to see much difference in behaviour, but memory usage and
run time may both go down slightly during normal test execution, and when
failing Hypothesis might print its failing example slightly sooner.
.. _v3.44.19:
--------------------
3.44.19 - 2018-01-21
--------------------
This changes how we compute the default ``average_size`` for all collection
strategies. Previously setting a ``max_size`` without setting an
``average_size`` would have the seemingly paradoxical effect of making data
generation *slower*, because it would raise the average size from its default.
Now setting ``max_size`` will either leave the default unchanged or lower it
from its default.
If you are currently experiencing this problem, this may make your tests
substantially faster. If you are not, this will likely have no effect on you.
.. _v3.44.18:
--------------------
3.44.18 - 2018-01-20
--------------------
This is a small refactoring release that changes how Hypothesis detects when
the structure of data generation depends on earlier values generated (e.g. when
using |.flatmap| or :func:`~hypothesis.strategies.composite`).
It should not have any observable effect on behaviour.
.. _v3.44.17:
--------------------
3.44.17 - 2018-01-15
--------------------
This release fixes a typo in internal documentation, and has no user-visible impact.
.. _v3.44.16:
--------------------
3.44.16 - 2018-01-13
--------------------
This release improves test case reduction for recursive data structures.
Hypothesis now guarantees that whenever a strategy calls itself recursively
(usually this will happen because you are using :func:`~hypothesis.strategies.deferred`),
any recursive call may replace the top level value. e.g. given a tree structure,
Hypothesis will always try replacing it with a subtree.
Additionally this introduces a new heuristic that may in some circumstances
significantly speed up test case reduction - Hypothesis should be better at
immediately replacing elements drawn inside another strategy with their minimal
possible value.
.. _v3.44.15:
--------------------
3.44.15 - 2018-01-13
--------------------
:func:`~hypothesis.strategies.from_type` can now resolve recursive types
such as binary trees (:issue:`1004`). Detection of non-type arguments has
also improved, leading to better error messages in many cases involving
:pep:`forward references <484#forward-references>`.
.. _v3.44.14:
--------------------
3.44.14 - 2018-01-08
--------------------
This release fixes a bug in the shrinker that prevented the optimisations in
:ref:`3.44.6 <v3.44.6>` from working in some cases. It would not have worked correctly when
filtered examples were nested (e.g. with a set of integers in some range).
This would not have resulted in any correctness problems, but shrinking may
have been slower than it otherwise could be.
.. _v3.44.13:
--------------------
3.44.13 - 2018-01-08
--------------------
This release changes the average bit length of values drawn from
:func:`~hypothesis.strategies.integers` to be much smaller. Additionally it
changes the shrinking order so that now size is considered before sign - e.g.
-1 will be preferred to +10.
The new internal format for integers required some changes to the minimizer to
make work well, so you may also see some improvements to example quality in
unrelated areas.
.. _v3.44.12:
--------------------
3.44.12 - 2018-01-07
--------------------
This changes Hypothesis's internal implementation of weighted sampling. This
will affect example distribution and quality, but you shouldn't see any other
effects.
.. _v3.44.11:
--------------------
3.44.11 - 2018-01-06
--------------------
This is a change to some internals around how Hypothesis handles avoiding
generating duplicate examples and seeking out novel regions of the search
space.
You are unlikely to see much difference as a result of it, but it fixes
a bug where an internal assertion could theoretically be triggered and has some
minor effects on the distribution of examples so could potentially find bugs
that have previously been missed.
.. _v3.44.10:
--------------------
3.44.10 - 2018-01-06
--------------------
This patch avoids creating debug statements when debugging is disabled.
Profiling suggests this is a 5-10% performance improvement (:issue:`1040`).
.. _v3.44.9:
-------------------
3.44.9 - 2018-01-06
-------------------
This patch blacklists null characters (``'\x00'``) in automatically created
strategies for Django :obj:`~django:django.db.models.CharField` and
:obj:`~django:django.db.models.TextField`, due to a database issue which
`was recently fixed upstream <https://code.djangoproject.com/ticket/28201>`_
(Hypothesis :issue:`1045`).
.. _v3.44.8:
-------------------
3.44.8 - 2018-01-06
-------------------
This release makes the Hypothesis shrinker slightly less greedy in order to
avoid local minima - when it gets stuck, it makes a small attempt to search
around the final example it would previously have returned to find a new
starting point to shrink from. This should improve example quality in some
cases, especially ones where the test data has dependencies among parts of it
that make it difficult for Hypothesis to proceed.
.. _v3.44.7:
-------------------
3.44.7 - 2018-01-04
-------------------
This release adds support for `Django 2
<https://www.djangoproject.com/weblog/2017/dec/02/django-20-released/>`_ in
the hypothesis-django extra.
This release drops support for Django 1.10, as it is no longer supported by
the Django team.
.. _v3.44.6:
-------------------
3.44.6 - 2018-01-02
-------------------
This release speeds up test case reduction in many examples by being better at
detecting large shrinks it can use to discard redundant parts of its input.
This will be particularly noticeable in examples that make use of filtering
and for some integer ranges.
.. _v3.44.5:
-------------------
3.44.5 - 2018-01-02
-------------------
Happy new year!
This is a no-op release that updates the year range on all of
the copyright headers in our source to include 2018.
.. _v3.44.4:
-------------------
3.44.4 - 2017-12-23
-------------------
This release fixes :issue:`1041`, which slowed tests by up to 6%
due to broken caching.
.. _v3.44.3:
-------------------
3.44.3 - 2017-12-21
-------------------
This release improves the shrinker in cases where examples drawn earlier can
affect how much data is drawn later (e.g. when you draw a length parameter in
a composite and then draw that many elements). Examples found in cases like
this should now be much closer to minimal.
.. _v3.44.2:
-------------------
3.44.2 - 2017-12-20
-------------------
This is a pure refactoring release which changes how Hypothesis manages its
set of examples internally. It should have no externally visible effects.
.. _v3.44.1:
-------------------
3.44.1 - 2017-12-18
-------------------
This release fixes :issue:`997`, in which under some circumstances the body of
tests run under Hypothesis would not show up when run under coverage even
though the tests were run and the code they called outside of the test file
would show up normally.
.. _v3.44.0:
-------------------
3.44.0 - 2017-12-17
-------------------
This release adds a new feature: The :func:`@reproduce_failure <hypothesis.reproduce_failure>` decorator,
designed to make it easy to use Hypothesis's binary format for examples to
reproduce a problem locally without having to share your example database
between machines.
This also changes when seeds are printed:
* They will no longer be printed for
normal falsifying examples, as there are now adequate ways of reproducing those
for all cases, so it just contributes noise.
* They will once again be printed when reusing examples from the database, as
health check failures should now be more reliable in this scenario so it will
almost always work in this case.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.43.1:
-------------------
3.43.1 - 2017-12-17
-------------------
This release fixes a bug with Hypothesis's database management - examples that
were found in the course of shrinking were saved in a way that indicated that
they had distinct causes, and so they would all be retried on the start of the
next test. The intended behaviour, which is now what is implemented, is that
only a bounded subset of these examples would be retried.
.. _v3.43.0:
-------------------
3.43.0 - 2017-12-17
-------------------
:exc:`~hypothesis.errors.HypothesisDeprecationWarning` now inherits from
:exc:`python:FutureWarning` instead of :exc:`python:DeprecationWarning`,
as recommended by :pep:`565` for user-facing warnings (:issue:`618`).
If you have not changed the default warnings settings, you will now see
each distinct :exc:`~hypothesis.errors.HypothesisDeprecationWarning`
instead of only the first.
.. _v3.42.2:
-------------------
3.42.2 - 2017-12-12
-------------------
This patch fixes :issue:`1017`, where instances of a list or tuple subtype
used as an argument to a strategy would be coerced to tuple.
.. _v3.42.1:
-------------------
3.42.1 - 2017-12-10
-------------------
This release has some internal cleanup, which makes reading the code
more pleasant and may shrink large examples slightly faster.
.. _v3.42.0:
-------------------
3.42.0 - 2017-12-09
-------------------
This release deprecates ``faker-extra``, which was designed as a transition
strategy but does not support example shrinking or coverage-guided discovery.
.. _v3.41.0:
-------------------
3.41.0 - 2017-12-06
-------------------
:func:`~hypothesis.strategies.sampled_from` can now sample from
one-dimensional numpy ndarrays. Sampling from multi-dimensional
ndarrays still results in a deprecation warning. Thanks to Charlie
Tanksley for this patch.
.. _v3.40.1:
-------------------
3.40.1 - 2017-12-04
-------------------
This release makes two changes:
* It makes the calculation of some of the metadata that Hypothesis uses for
shrinking occur lazily. This should speed up performance of test case
generation a bit because it no longer calculates information it doesn't need.
* It improves the shrinker for certain classes of nested examples. e.g. when
shrinking lists of lists, the shrinker is now able to concatenate two
adjacent lists together into a single list. As a result of this change,
shrinking may get somewhat slower when the minimal example found is large.
.. _v3.40.0:
-------------------
3.40.0 - 2017-12-02
-------------------
This release improves how various ways of seeding Hypothesis interact with the
example database:
* Using the example database with :func:`~hypothesis.seed` is now deprecated.
You should set ``database=None`` if you are doing that. This will only warn
if you actually load examples from the database while using ``@seed``.
* The :attr:`~hypothesis.settings.derandomize` will behave the same way as
``@seed``.
* Using ``--hypothesis-seed`` will disable use of the database.
* If a test used examples from the database, it will not suggest using a seed
to reproduce it, because that won't work.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.39.0:
-------------------
3.39.0 - 2017-12-01
-------------------
This release adds a new health check that checks if the smallest "natural"
possible example of your test case is very large - this will tend to cause
Hypothesis to generate bad examples and be quite slow.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.38.9:
-------------------
3.38.9 - 2017-11-29
-------------------
This is a documentation release to improve the documentation of shrinking
behaviour for Hypothesis's strategies.
.. _v3.38.8:
-------------------
3.38.8 - 2017-11-29
-------------------
This release improves the performance of
:func:`~hypothesis.strategies.characters` when using ``exclude_characters``
and :func:`~hypothesis.strategies.from_regex` when using negative character
classes.
The problems this fixes were found in the course of work funded by
`Smarkets <https://smarkets.com/>`_.
.. _v3.38.7:
-------------------
3.38.7 - 2017-11-29
-------------------
This is a patch release for :func:`~hypothesis.strategies.from_regex`, which
had a bug in handling of the :obj:`python:re.VERBOSE` flag (:issue:`992`).
Flags are now handled correctly when parsing regex.
.. _v3.38.6:
-------------------
3.38.6 - 2017-11-28
-------------------
This patch changes a few byte-string literals from double to single quotes,
thanks to an update in :pypi:`unify`. There are no user-visible changes.
.. _v3.38.5:
-------------------
3.38.5 - 2017-11-23
-------------------
This fixes the repr of strategies using lambda that are defined inside
decorators to include the lambda source.
This would mostly have been visible when using the
:ref:`statistics <statistics>` functionality - lambdas used for e.g. filtering
would have shown up with a ``<unknown>`` as their body. This can still happen,
but it should happen less often now.
.. _v3.38.4:
-------------------
3.38.4 - 2017-11-22
-------------------
This release updates the reported :ref:`statistics <statistics>` so that they
show approximately what fraction of your test run time is spent in data
generation (as opposed to test execution).
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.38.3:
-------------------
3.38.3 - 2017-11-21
-------------------
This is a documentation release, which ensures code examples are up to date
by running them as doctests in CI (:issue:`711`).
.. _v3.38.2:
-------------------
3.38.2 - 2017-11-21
-------------------
This release changes the behaviour of the :attr:`~hypothesis.settings.deadline`
setting when used with :func:`~hypothesis.strategies.data`: Time spent inside
calls to ``data.draw`` will no longer be counted towards the deadline time.
As a side effect of some refactoring required for this work, the way flaky
tests are handled has changed slightly. You are unlikely to see much difference
from this, but some error messages will have changed.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.38.1:
-------------------
3.38.1 - 2017-11-21
-------------------
This patch has a variety of non-user-visible refactorings, removing various
minor warts ranging from indirect imports to typos in comments.
.. _v3.38.0:
-------------------
3.38.0 - 2017-11-18
-------------------
This release overhauls the |HealthCheck| system
in a variety of small ways.
It adds no new features, but is nevertheless a minor release because it changes
which tests are likely to fail health checks.
The most noticeable effect is that some tests that used to fail health checks
will now pass, and some that used to pass will fail. These should all be
improvements in accuracy. In particular:
* New failures will usually be because they are now taking into account things
like use of :func:`~hypothesis.strategies.data` and
:func:`~hypothesis.assume` inside the test body.
* New failures *may* also be because for some classes of example the way data
generation performance was measured was artificially faster than real data
generation (for most examples that are hitting performance health checks the
opposite should be the case).
* Tests that used to fail health checks and now pass do so because the health
check system used to run in a way that was subtly different than the main
Hypothesis data generation and lacked some of its support for e.g. large
examples.
If your data generation is especially slow, you may also see your tests get
somewhat faster, as there is no longer a separate health check phase. This will
be particularly noticeable when rerunning test failures.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.37.0:
-------------------
3.37.0 - 2017-11-12
-------------------
This is a deprecation release for some health check related features.
The following are now deprecated:
* Passing ``HealthCheck.exception_in_generation`` to
:attr:`~hypothesis.settings.suppress_health_check`. This no longer does
anything even when passed - All errors that occur during data generation
will now be immediately reraised rather than going through the health check
mechanism.
* Passing ``HealthCheck.random_module`` to
:attr:`~hypothesis.settings.suppress_health_check`. This hasn't done anything
for a long time, but was never explicitly deprecated. Hypothesis always seeds
the random module when running :func:`@given <hypothesis.given>` tests, so this
is no longer an error and suppressing it doesn't do anything.
* Passing non-:class:`~hypothesis.HealthCheck` values in
:attr:`~hypothesis.settings.suppress_health_check`. This was previously
allowed but never did anything useful.
In addition, passing a non-iterable value as :attr:`~hypothesis.settings.suppress_health_check`
will now raise an error immediately (it would never have worked correctly, but
it would previously have failed later). Some validation error messages have
also been updated.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.36.1:
-------------------
3.36.1 - 2017-11-10
-------------------
This is a yak shaving release, mostly concerned with our own tests.
While :func:`~python:inspect.getfullargspec` was documented as deprecated
in Python 3.5, it never actually emitted a warning. Our code to silence
this (nonexistent) warning has therefore been removed.
We now run our tests with ``DeprecationWarning`` as an error, and made some
minor changes to our own tests as a result. This required similar upstream
updates to :pypi:`coverage` and :pypi:`execnet` (a test-time dependency via
:pypi:`pytest-xdist`).
There is no user-visible change in Hypothesis itself, but we encourage you
to consider enabling deprecations as errors in your own tests.
.. _v3.36.0:
-------------------
3.36.0 - 2017-11-06
-------------------
This release adds a setting to the public API, and does some internal cleanup:
- The :attr:`~hypothesis.settings.derandomize` setting is now documented (:issue:`890`)
- Removed - and disallowed - all 'bare excepts' in Hypothesis (:issue:`953`)
- Documented the ``strict`` setting as deprecated, and
updated the build so our docs always match deprecations in the code.
.. _v3.35.0:
-------------------
3.35.0 - 2017-11-06
-------------------
This minor release supports constraining :func:`~hypothesis.strategies.uuids`
to generate a particular version of :class:`~python:uuid.UUID` (:issue:`721`).
Thanks to Dion Misic for this feature.
.. _v3.34.1:
-------------------
3.34.1 - 2017-11-02
-------------------
This patch updates the documentation to suggest
:func:`builds(callable) <hypothesis.strategies.builds>` instead of
:func:`just(callable()) <hypothesis.strategies.just>`.
.. _v3.34.0:
-------------------
3.34.0 - 2017-11-02
-------------------
Hypothesis now emits deprecation warnings if you apply
:func:`@given <hypothesis.given>` more than once to a target.
Applying :func:`@given <hypothesis.given>` repeatedly wraps the target multiple
times. Each wrapper will search the space of of possible parameters separately.
This is equivalent but will be much more inefficient than doing it with a
single call to :func:`@given <hypothesis.given>`.
For example, instead of
``@given(booleans()) @given(integers())``, you could write
``@given(booleans(), integers())``
.. _v3.33.1:
-------------------
3.33.1 - 2017-11-02
-------------------
This is a bugfix release:
- :func:`~hypothesis.strategies.builds` would try to infer a strategy for
required positional arguments of the target from type hints, even if they
had been given to :func:`~hypothesis.strategies.builds` as positional
arguments (:issue:`946`). Now it only infers missing required arguments.
- An internal introspection function wrongly reported ``self`` as a required
argument for bound methods, which might also have affected
:func:`~hypothesis.strategies.builds`. Now it knows better.
.. _v3.33.0:
-------------------
3.33.0 - 2017-10-16
-------------------
This release supports strategy inference for more Django field types - you can now omit an argument for
Date, Time, Duration, Slug, IP Address, and UUID fields. (:issue:`642`)
Strategy generation for fields with grouped choices now selects choices from
each group, instead of selecting from the group names.
.. _v3.32.2:
-------------------
3.32.2 - 2017-10-15
-------------------
This patch removes the ``mergedb`` tool, introduced in Hypothesis 1.7.1
on an experimental basis. It has never actually worked, and the new
:ref:`Hypothesis example database <database>` is designed to make such a
tool unnecessary.
.. _v3.32.1:
-------------------
3.32.1 - 2017-10-13
-------------------
This patch has two improvements for strategies based on enumerations.
- :func:`~hypothesis.strategies.from_type` now handles enumerations correctly,
delegating to :func:`~hypothesis.strategies.sampled_from`. Previously it
noted that ``Enum.__init__`` has no required arguments and therefore delegated
to :func:`~hypothesis.strategies.builds`, which would subsequently fail.
- When sampling from an :class:`python:enum.Flag`, we also generate combinations
of members. Eg for ``Flag('Permissions', 'READ, WRITE, EXECUTE')`` we can now
generate, ``Permissions.READ``, ``Permissions.READ|WRITE``, and so on.
.. _v3.32.0:
-------------------
3.32.0 - 2017-10-09
-------------------
This changes the default value of
the ``use_coverage`` setting to True when
running on pypy (it was already True on CPython).
It was previously set to False because we expected it to be too slow, but
recent benchmarking shows that actually performance of the feature on pypy is
fairly acceptable - sometimes it's slower than on CPython, sometimes it's
faster, but it's generally within a factor of two either way.
.. _v3.31.6:
-------------------
3.31.6 - 2017-10-08
-------------------
This patch improves the quality of strategies inferred from Numpy dtypes:
* Integer dtypes generated examples with the upper half of their (non-sign) bits
set to zero. The inferred strategies can now produce any representable integer.
* Fixed-width unicode- and byte-string dtypes now cap the internal example
length, which should improve example and shrink quality.
* Numpy arrays can only store fixed-size strings internally, and allow shorter
strings by right-padding them with null bytes. Inferred string strategies
no longer generate such values, as they can never be retrieved from an array.
This improves shrinking performance by skipping useless values.
This has already been useful in Hypothesis - we found an overflow bug in our
Pandas support, and as a result :func:`~hypothesis.extra.pandas.indexes` and
:func:`~hypothesis.extra.pandas.range_indexes` now check that ``min_size``
and ``max_size`` are at least zero.
.. _v3.31.5:
-------------------
3.31.5 - 2017-10-08
-------------------
This release fixes a performance problem in tests where
the ``use_coverage`` setting is True.
Tests experience a slow-down proportionate to the amount of code they cover.
This is still the case, but the factor is now low enough that it should be
unnoticeable. Previously it was large and became much larger in :ref:`3.30.4 <v3.30.4>`.
.. _v3.31.4:
-------------------
3.31.4 - 2017-10-08
-------------------
:func:`~hypothesis.strategies.from_type` failed with a very confusing error
if passed a :obj:`~typing.NewType` (:issue:`901`). These pseudo-types
are now unwrapped correctly, and strategy inference works as expected.
.. _v3.31.3:
-------------------
3.31.3 - 2017-10-06
-------------------
This release makes some small optimisations to our use of coverage that should
reduce constant per-example overhead. This is probably only noticeable on
examples where the test itself is quite fast. On no-op tests that don't test
anything you may see up to a fourfold speed increase (which is still
significantly slower than without coverage). On more realistic tests the speed
up is likely to be less than that.
.. _v3.31.2:
-------------------
3.31.2 - 2017-09-30
-------------------
This release fixes some formatting and small typos/grammar issues in the
documentation, specifically the page docs/settings.rst, and the inline docs
for the various settings.
.. _v3.31.1:
-------------------
3.31.1 - 2017-09-30
-------------------
This release improves the handling of deadlines so that they act better with
the shrinking process. This fixes :issue:`892`.
This involves two changes:
1. The deadline is raised during the initial generation and shrinking, and then
lowered to the set value for final replay. This restricts our attention to
examples which exceed the deadline by a more significant margin, which
increases their reliability.
2. When despite the above a test still becomes flaky because it is
significantly faster on rerun than it was on its first run, the error
message is now more explicit about the nature of this problem, and includes
both the initial test run time and the new test run time.
In addition, this release also clarifies the documentation of the deadline
setting slightly to be more explicit about where it applies.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.31.0:
-------------------
3.31.0 - 2017-09-29
-------------------
This release blocks installation of Hypothesis on Python 3.3, which
:PEP:`reached its end of life date on 2017-09-29 <398>`.
This should not be of interest to anyone but downstream maintainers -
if you are affected, migrate to a secure version of Python as soon as
possible or at least seek commercial support.
.. _v3.30.4:
-------------------
3.30.4 - 2017-09-27
-------------------
This release makes several changes:
1. It significantly improves Hypothesis's ability to use coverage information
to find interesting examples.
2. It reduces the default :attr:`~hypothesis.settings.max_examples` setting from 200 to 100. This takes
advantage of the improved algorithm meaning fewer examples are typically
needed to get the same testing and is sufficiently better at covering
interesting behaviour, and offsets some of the performance problems of
running under coverage.
3. Hypothesis will always try to start its testing with an example that is near
minimized.
The new algorithm for 1 also makes some changes to Hypothesis's low level data
generation which apply even with coverage turned off. They generally reduce the
total amount of data generated, which should improve test performance somewhat.
Between this and 3 you should see a noticeable reduction in test runtime (how
much so depends on your tests and how much example size affects their
performance. On our benchmarks, where data generation dominates, we saw up to
a factor of two performance improvement, but it's unlikely to be that large.
.. _v3.30.3:
-------------------
3.30.3 - 2017-09-25
-------------------
This release fixes some formatting and small typos/grammar issues in the
documentation, specifically the page docs/details.rst, and some inline
docs linked from there.
.. _v3.30.2:
-------------------
3.30.2 - 2017-09-24
-------------------
This release changes Hypothesis's caching approach for functions in
``hypothesis.strategies``. Previously it would have cached extremely
aggressively and cache entries would never be evicted. Now it adopts a
least-frequently used, least recently used key invalidation policy, and is
somewhat more conservative about which strategies it caches.
Workloads which create strategies based on dynamic values, e.g. by using
|.flatmap| or :func:`~hypothesis.strategies.composite`,
will use significantly less memory.
.. _v3.30.1:
-------------------
3.30.1 - 2017-09-22
-------------------
This release fixes a bug where when running with
the ``use_coverage=True`` setting inside an
existing running instance of coverage, Hypothesis would frequently put files
that the coveragerc excluded in the report for the enclosing coverage.
.. _v3.30.0:
-------------------
3.30.0 - 2017-09-20
-------------------
This release introduces two new features:
* When a test fails, either with a health check failure or a falsifying example,
Hypothesis will print out a seed that led to that failure, if the test is not
already running with a fixed seed. You can then recreate that failure using either
the :func:`@seed <hypothesis.seed>` decorator or (if you are running pytest) with ``--hypothesis-seed``.
* :pypi:`pytest` users can specify a seed to use for :func:`@given <hypothesis.given>` based tests by passing
the ``--hypothesis-seed`` command line argument.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.29.0:
-------------------
3.29.0 - 2017-09-19
-------------------
This release makes Hypothesis coverage aware. Hypothesis now runs all test
bodies under coverage, and uses this information to guide its testing.
The ``use_coverage`` setting can be used to disable
this behaviour if you want to test code that is sensitive to coverage being
enabled (either because of performance or interaction with the trace function).
The main benefits of this feature are:
* Hypothesis now observes when examples it discovers cover particular lines
or branches and stores them in the database for later.
* Hypothesis will make some use of this information to guide its exploration of
the search space and improve the examples it finds (this is currently used
only very lightly and will likely improve significantly in future releases).
This also has the following side-effects:
* Hypothesis now has an install time dependency on the :pypi:`coverage` package.
* Tests that are already running Hypothesis under coverage will likely get
faster.
* Tests that are not running under coverage now run their test bodies under
coverage by default.
This feature is only partially supported under pypy. It is significantly slower
than on CPython and is turned off by default as a result, but it should still
work correctly if you want to use it.
.. _v3.28.3:
-------------------
3.28.3 - 2017-09-18
-------------------
This release is an internal change that affects how Hypothesis handles
calculating certain properties of strategies.
The primary effect of this is that it fixes a bug where use of
:func:`~hypothesis.strategies.deferred` could sometimes trigger an internal assertion
error. However the fix for this bug involved some moderately deep changes to
how Hypothesis handles certain constructs so you may notice some additional
knock-on effects.
In particular the way Hypothesis handles drawing data from strategies that
cannot generate any values has changed to bail out sooner than it previously
did. This may speed up certain tests, but it is unlikely to make much of a
difference in practice for tests that were not already failing with
Unsatisfiable.
.. _v3.28.2:
-------------------
3.28.2 - 2017-09-18
-------------------
This is a patch release that fixes a bug in the :mod:`hypothesis.extra.pandas`
documentation where it incorrectly referred to :func:`~hypothesis.extra.pandas.column`
instead of :func:`~hypothesis.extra.pandas.columns`.
.. _v3.28.1:
-------------------
3.28.1 - 2017-09-16
-------------------
This is a refactoring release. It moves a number of internal uses
of :func:`~python:collections.namedtuple` over to using attrs based classes, and removes a couple
of internal namedtuple classes that were no longer in use.
It should have no user visible impact.
.. _v3.28.0:
-------------------
3.28.0 - 2017-09-15
-------------------
This release adds support for testing :pypi:`pandas` via the :ref:`hypothesis.extra.pandas <hypothesis-pandas>`
module.
It also adds a dependency on :pypi:`attrs`.
This work was funded by `Stripe <https://stripe.com/>`_.
.. _v3.27.1:
-------------------
3.27.1 - 2017-09-14
-------------------
This release fixes some formatting and broken cross-references in the
documentation, which includes editing docstrings - and thus a patch release.
.. _v3.27.0:
-------------------
3.27.0 - 2017-09-13
-------------------
This release introduces a :attr:`~hypothesis.settings.deadline`
setting to Hypothesis.
When set this turns slow tests into errors. By default it is unset but will
warn if you exceed 200ms, which will become the default value in a future
release.
This work was funded by `Smarkets <https://smarkets.com/>`_.
.. _v3.26.0:
-------------------
3.26.0 - 2017-09-12
-------------------
Hypothesis now emits deprecation warnings if you are using the legacy
SQLite example database format, or the tool for merging them. These were
already documented as deprecated, so this doesn't change their deprecation
status, only that we warn about it.
.. _v3.25.1:
-------------------
3.25.1 - 2017-09-12
-------------------
This release fixes a bug with generating :doc:`numpy datetime and timedelta types <numpy:reference/arrays.datetime>`:
When inferring the strategy from the dtype, datetime and timedelta dtypes with
sub-second precision would always produce examples with one second resolution.
Inferring a strategy from a time dtype will now always produce example with the
same precision.
.. _v3.25.0:
-------------------
3.25.0 - 2017-09-12
-------------------
This release changes how Hypothesis shrinks and replays examples to take into
account that it can encounter new bugs while shrinking the bug it originally
found. Previously it would end up replacing the originally found bug with the
new bug and show you only that one. Now it is (often) able to recognise when
two bugs are distinct and when it finds more than one will show both.
.. _v3.24.2:
-------------------
3.24.2 - 2017-09-11
-------------------
This release removes the (purely internal and no longer useful)
``strategy_test_suite`` function and the corresponding strategytests module.
.. _v3.24.1:
-------------------
3.24.1 - 2017-09-06
-------------------
This release improves the reduction of examples involving floating point
numbers to produce more human readable examples.
It also has some general purpose changes to the way the minimizer works
internally, which may see some improvement in quality and slow down of test
case reduction in cases that have nothing to do with floating point numbers.
.. _v3.24.0:
-------------------
3.24.0 - 2017-09-05
-------------------
Hypothesis now emits deprecation warnings if you use ``some_strategy.example()`` inside a
test function or strategy definition (this was never intended to be supported,
but is sufficiently widespread that it warrants a deprecation path).
.. _v3.23.3:
-------------------
3.23.3 - 2017-09-05
-------------------
This is a bugfix release for :func:`~hypothesis.strategies.decimals`
with the ``places`` argument.
- No longer fails health checks (:issue:`725`, due to internal filtering)
- Specifying a ``min_value`` and ``max_value`` without any decimals with
``places`` places between them gives a more useful error message.
- Works for any valid arguments, regardless of the decimal precision context.
.. _v3.23.2:
-------------------
3.23.2 - 2017-09-01
-------------------
This is a small refactoring release that removes a now-unused parameter to an
internal API. It shouldn't have any user visible effect.
.. _v3.23.1:
-------------------
3.23.1 - 2017-09-01
-------------------
Hypothesis no longer propagates the dynamic scope of settings into strategy
definitions.
This release is a small change to something that was never part of the public
API and you will almost certainly not notice any effect unless you're doing
something surprising, but for example the following code will now give a
different answer in some circumstances:
.. code-block:: python
import hypothesis.strategies as st
from hypothesis import settings
CURRENT_SETTINGS = st.builds(lambda: settings.default)
(We don't actually encourage you writing code like this)
Previously this would have generated the settings that were in effect at the
point of definition of ``CURRENT_SETTINGS``. Now it will generate the settings
that are used for the current test.
It is very unlikely to be significant enough to be visible, but you may also
notice a small performance improvement.
.. _v3.23.0:
-------------------
3.23.0 - 2017-08-31
-------------------
This release adds a ``unique`` argument to :func:`~hypothesis.extra.numpy.arrays`
which behaves the same ways as the corresponding one for
:func:`~hypothesis.strategies.lists`, requiring all of the elements in the
generated array to be distinct.
.. _v3.22.2:
-------------------
3.22.2 - 2017-08-29
-------------------
This release fixes an issue where Hypothesis would raise a ``TypeError`` when
using the datetime-related strategies if running with ``PYTHONOPTIMIZE=2``.
This bug was introduced in :ref:`3.20.0 <v3.20.0>`. (See :issue:`822`)
.. _v3.22.1:
-------------------
3.22.1 - 2017-08-28
-------------------
Hypothesis now transparently handles problems with an internal unicode cache,
including file truncation or read-only filesystems (:issue:`767`).
Thanks to Sam Hames for the patch.
.. _v3.22.0:
-------------------
3.22.0 - 2017-08-26
-------------------
This release provides what should be a substantial performance improvement to
numpy arrays generated using :ref:`provided numpy support <hypothesis-numpy>`,
and adds a new ``fill_value`` argument to :func:`~hypothesis.extra.numpy.arrays`
to control this behaviour.
This work was funded by `Stripe <https://stripe.com/>`_.
.. _v3.21.3:
-------------------
3.21.3 - 2017-08-26
-------------------
This release fixes some extremely specific circumstances that probably have
never occurred in the wild where users of
:func:`~hypothesis.strategies.deferred` might have seen a :class:`python:RuntimeError` from
too much recursion, usually in cases where no valid example could have been
generated anyway.
.. _v3.21.2:
-------------------
3.21.2 - 2017-08-25
-------------------
This release fixes some minor bugs in argument validation:
* :ref:`hypothesis.extra.numpy <hypothesis-numpy>` dtype strategies would raise an internal error
instead of an InvalidArgument exception when passed an invalid
endianness specification.
* :func:`~hypothesis.strategies.fractions` would raise an internal error instead of an InvalidArgument
if passed ``float("nan")`` as one of its bounds.
* The error message for passing ``float("nan")`` as a bound to various
strategies has been improved.
* Various bound arguments will now raise InvalidArgument in cases where
they would previously have raised an internal TypeError or
ValueError from the relevant conversion function.
* ``streaming()`` would not have emitted a
deprecation warning when called with an invalid argument.
.. _v3.21.1:
-------------------
3.21.1 - 2017-08-24
-------------------
This release fixes a bug where test failures that were the result of
an :obj:`@example <hypothesis.example>` would print an extra stack trace before re-raising the
exception.
.. _v3.21.0:
-------------------
3.21.0 - 2017-08-23
-------------------
This release deprecates Hypothesis's strict mode, which turned Hypothesis's
deprecation warnings into errors. Similar functionality can be achieved
by using :func:`simplefilter('error', HypothesisDeprecationWarning) <python:warnings.simplefilter>`.
.. _v3.20.0:
-------------------
3.20.0 - 2017-08-22
-------------------
This release renames the relevant arguments on the
:func:`~hypothesis.strategies.datetimes`, :func:`~hypothesis.strategies.dates`,
:func:`~hypothesis.strategies.times`, and :func:`~hypothesis.strategies.timedeltas`
strategies to ``min_value`` and ``max_value``, to make them consistent with the
other strategies in the module.
The old argument names are still supported but will emit a deprecation warning
when used explicitly as keyword arguments. Arguments passed positionally will
go to the new argument names and are not deprecated.
.. _v3.19.3:
-------------------
3.19.3 - 2017-08-22
-------------------
This release provides a major overhaul to the internals of how Hypothesis
handles shrinking.
This should mostly be visible in terms of getting better examples for tests
which make heavy use of :func:`~hypothesis.strategies.composite`,
:func:`~hypothesis.strategies.data` or |.flatmap| where the data
drawn depends a lot on previous choices, especially where size parameters are
affected. Previously Hypothesis would have struggled to reliably produce
good examples here. Now it should do much better. Performance should also be
better for examples with a non-zero ``min_size``.
You may see slight changes to example generation (e.g. improved example
diversity) as a result of related changes to internals, but they are unlikely
to be significant enough to notice.
.. _v3.19.2:
-------------------
3.19.2 - 2017-08-21
-------------------
This release fixes two bugs in :mod:`hypothesis.extra.numpy`:
* :func:`~hypothesis.extra.numpy.unicode_string_dtypes` didn't work at all due
to an incorrect dtype specifier. Now it does.
* Various impossible conditions would have been accepted but would error when
they fail to produced any example. Now they raise an explicit InvalidArgument
error.
.. _v3.19.1:
-------------------
3.19.1 - 2017-08-21
-------------------
This is a bugfix release for :issue:`739`, where bounds for
:func:`~hypothesis.strategies.fractions` or floating-point
:func:`~hypothesis.strategies.decimals` were not properly converted to
integers before passing them to the integers strategy.
This excluded some values that should have been possible, and could
trigger internal errors if the bounds lay between adjacent integers.
You can now bound :func:`~hypothesis.strategies.fractions` with two
arbitrarily close fractions.
It is now an explicit error to supply a min_value, max_value, and
max_denominator to :func:`~hypothesis.strategies.fractions` where the value
bounds do not include a fraction with denominator at most max_denominator.
.. _v3.19.0:
-------------------
3.19.0 - 2017-08-20
-------------------
This release adds the :func:`~hypothesis.strategies.from_regex` strategy,
which generates strings that contain a match of a regular expression.
Thanks to Maxim Kulkin for creating the
`hypothesis-regex <https://github.com/maximkulkin/hypothesis-regex>`_
package and then helping to upstream it! (:issue:`662`)
.. _v3.18.5:
-------------------
3.18.5 - 2017-08-18
-------------------
This is a bugfix release for :func:`~hypothesis.strategies.integers`.
Previously the strategy would hit an internal assertion if passed non-integer
bounds for ``min_value`` and ``max_value`` that had no integers between them.
The strategy now raises InvalidArgument instead.
.. _v3.18.4:
-------------------
3.18.4 - 2017-08-18
-------------------
Release to fix a bug where mocks can be used as test runners under certain
conditions. Specifically, if a mock is injected into a test via pytest
fixtures or patch decorators, and that mock is the first argument in the
list, hypothesis will think it represents self and turns the mock
into a test runner. If this happens, the affected test always passes
because the mock is executed instead of the test body. Sometimes, it
will also fail health checks.
Fixes :issue:`491` and a section of :issue:`198`.
Thanks to Ben Peterson for this bug fix.
.. _v3.18.3:
-------------------
3.18.3 - 2017-08-17
-------------------
This release should improve the performance of some tests which
experienced a slow down as a result of the :ref:`3.13.0 <v3.13.0>` release.
Tests most likely to benefit from this are ones that make extensive
use of ``min_size`` parameters, but others may see some improvement
as well.
.. _v3.18.2:
-------------------
3.18.2 - 2017-08-16
-------------------
This release fixes a bug introduced in :ref:`3.18.0 <v3.18.0>`. If the arguments
``include_characters`` and ``exclude_characters`` to
:func:`~hypothesis.strategies.characters` contained overlapping elements, then an
``InvalidArgument`` exception would be raised.
Thanks to Zac Hatfield-Dodds for reporting and fixing this.
.. _v3.18.1:
-------------------
3.18.1 - 2017-08-14
-------------------
This is a bug fix release to fix :issue:`780`, where
:func:`~hypothesis.strategies.sets` and similar would trigger health check
errors if their element strategy could only produce one element (e.g.
if it was :func:`~hypothesis.strategies.just`).
.. _v3.18.0:
-------------------
3.18.0 - 2017-08-13
-------------------
This is a feature release:
* :func:`~hypothesis.strategies.characters` now accepts
``include_characters``, particular characters which will be added to those
it produces. (:issue:`668`)
* A bug fix for the internal function ``_union_interval_lists()``, and a rename
to ``_union_intervals()``. It now correctly handles all cases where intervals
overlap, and it always returns the result as a tuple for tuples.
Thanks to Alex Willmer for these.
.. _v3.17.0:
-------------------
3.17.0 - 2017-08-07
-------------------
This release documents the previously undocumented phases feature in |Phase|,
making it part of the public API. It also updates how the example
database is used. Principally:
* The :obj:`~hypothesis.Phase.reuse` phase will now correctly control whether examples
from the database are run (it previously did exactly the wrong thing and
controlled whether examples would be *saved*).
* Hypothesis will no longer try to rerun *all* previously failing examples.
Instead it will replay the smallest previously failing example and a
selection of other examples that are likely to trigger any other bugs that
will found. This prevents a previous failure from dominating your tests
unnecessarily.
* As a result of the previous change, Hypothesis will be slower about clearing
out old examples from the database that are no longer failing (because it can
only clear out ones that it actually runs).
.. _v3.16.1:
-------------------
3.16.1 - 2017-08-07
-------------------
This release makes an implementation change to how Hypothesis handles certain
internal constructs.
The main effect you should see is improvement to the behaviour and performance
of collection types, especially ones with a ``min_size`` parameter. Many cases
that would previously fail due to being unable to generate enough valid
examples will now succeed, and other cases should run slightly faster.
.. _v3.16.0:
-------------------
3.16.0 - 2017-08-04
-------------------
This release introduces a deprecation of the timeout feature. This results in
the following changes:
* Creating a settings object with an explicit timeout will emit a deprecation
warning.
* If your test stops because it hits the timeout (and has not found a bug) then
it will emit a deprecation warning.
* There is a new value ``unlimited`` which you can import from hypothesis.
``settings(timeout=unlimited)`` will *not* cause a deprecation warning.
* There is a new health check, ``hung_test``, which will trigger after a test
has been running for five minutes if it is not suppressed.
.. _v3.15.0:
-------------------
3.15.0 - 2017-08-04
-------------------
This release deprecates two strategies, ``choices()`` and ``streaming()``.
Both of these are somewhat confusing to use and are entirely redundant since the
introduction of the :func:`~hypothesis.strategies.data` strategy for interactive
drawing in tests, and their use should be replaced with direct use of
:func:`~hypothesis.strategies.data` instead.
.. _v3.14.2:
-------------------
3.14.2 - 2017-08-03
-------------------
This fixes a bug where Hypothesis would not work correctly on Python 2.7 if you
had the :mod:`python:typing` module :pypi:`backport <typing>` installed.
.. _v3.14.1:
-------------------
3.14.1 - 2017-08-02
-------------------
This raises the maximum depth at which Hypothesis starts cutting off data
generation to a more reasonable value which it is harder to hit by accident.
This resolves (:issue:`751`), in which some examples which previously worked
would start timing out, but it will also likely improve the data generation
quality for complex data types.
.. _v3.14.0:
-------------------
3.14.0 - 2017-07-23
-------------------
Hypothesis now understands inline type annotations (:issue:`293`):
- If the target of :func:`~hypothesis.strategies.builds` has type annotations,
a default strategy for missing required arguments is selected based on the
type. Type-based strategy selection will only override a default if you
pass :const:`hypothesis.infer` as a keyword argument.
- If :func:`@given <hypothesis.given>` wraps a function with type annotations,
you can pass :const:`~hypothesis.infer` as a keyword argument and the
appropriate strategy will be substituted.
- You can check what strategy will be inferred for a type with the new
:func:`~hypothesis.strategies.from_type` function.
- :func:`~hypothesis.strategies.register_type_strategy` teaches Hypothesis
which strategy to infer for custom or unknown types. You can provide a
strategy, or for more complex cases a function which takes the type and
returns a strategy.
.. _v3.13.1:
-------------------
3.13.1 - 2017-07-20
-------------------
This is a bug fix release for :issue:`514` - Hypothesis would continue running
examples after a :class:`~python:unittest.SkipTest` exception was raised,
including printing a falsifying example. Skip exceptions from the standard
:mod:`python:unittest` module, and ``pytest``, ``nose``, or ``unittest2``
modules now abort the test immediately without printing output.
.. _v3.13.0:
-------------------
3.13.0 - 2017-07-16
-------------------
This release has two major aspects to it: The first is the introduction of
:func:`~hypothesis.strategies.deferred`, which allows more natural definition
of recursive (including mutually recursive) strategies.
The second is a number of engine changes designed to support this sort of
strategy better. These should have a knock-on effect of also improving the
performance of any existing strategies that currently generate a lot of data
or involve heavy nesting by reducing their typical example size.
.. _v3.12.0:
-------------------
3.12.0 - 2017-07-07
-------------------
This release makes some major internal changes to how Hypothesis represents
data internally, as a prelude to some major engine changes that should improve
data quality. There are no API changes, but it's a significant enough internal
change that a minor version bump seemed warranted.
User facing impact should be fairly mild, but includes:
* All existing examples in the database will probably be invalidated. Hypothesis
handles this automatically, so you don't need to do anything, but if you see
all your examples disappear that's why.
* Almost all data distributions have changed significantly. Possibly for the better,
possibly for the worse. This may result in new bugs being found, but it may
also result in Hypothesis being unable to find bugs it previously did.
* Data generation may be somewhat faster if your existing bottleneck was in
draw_bytes (which is often the case for large examples).
* Shrinking will probably be slower, possibly significantly.
If you notice any effects you consider to be a significant regression, please
open an issue about them.
.. _v3.11.6:
-------------------
3.11.6 - 2017-06-19
-------------------
This release involves no functionality changes, but is the first to ship wheels
as well as an sdist.
.. _v3.11.5:
-------------------
3.11.5 - 2017-06-18
-------------------
This release provides a performance improvement to shrinking. For cases where
there is some non-trivial "boundary" value (e.g. the bug happens for all values
greater than some other value), shrinking should now be substantially faster.
Other types of bug will likely see improvements too.
This may also result in some changes to the quality of the final examples - it
may sometimes be better, but is more likely to get slightly worse in some edge
cases. If you see any examples where this happens in practice, please report
them.
.. _v3.11.4:
-------------------
3.11.4 - 2017-06-17
-------------------
This is a bugfix release: Hypothesis now prints explicit examples when
running in verbose mode. (:issue:`313`)
.. _v3.11.3:
-------------------
3.11.3 - 2017-06-11
-------------------
This is a bugfix release: Hypothesis no longer emits a warning if you try to
use :func:`~hypothesis.strategies.sampled_from` with
:class:`python:collections.OrderedDict`. (:issue:`688`)
.. _v3.11.2:
-------------------
3.11.2 - 2017-06-10
-------------------
This is a documentation release. Several outdated snippets have been updated
or removed, and many cross-references are now hyperlinks.
.. _v3.11.1:
-------------------
3.11.1 - 2017-05-28
-------------------
This is a minor ergonomics release. Tracebacks shown by pytest no longer
include Hypothesis internals for test functions decorated with :func:`@given <hypothesis.given>`.
.. _v3.11.0:
-------------------
3.11.0 - 2017-05-23
-------------------
This is a feature release, adding datetime-related strategies to the core strategies.
:func:`~hypothesis.extra.pytz.timezones` allows you to sample pytz timezones from
the Olsen database. Use directly in a recipe for tz-aware datetimes, or
compose with :func:`~hypothesis.strategies.none` to allow a mix of aware and naive output.
The new :func:`~hypothesis.strategies.dates`, :func:`~hypothesis.strategies.times`,
:func:`~hypothesis.strategies.datetimes`, and :func:`~hypothesis.strategies.timedeltas`
strategies are all constrained by objects of their type.
This means that you can generate dates bounded by a single day
(i.e. a single date), or datetimes constrained to the microsecond.
:func:`~hypothesis.strategies.times` and :func:`~hypothesis.strategies.datetimes`
take an optional ``timezones=`` argument, which
defaults to :func:`~hypothesis.strategies.none` for naive times. You can use our extra strategy
based on pytz, or roll your own timezones strategy with dateutil or even
the standard library.
The old ``dates``, ``times``, and ``datetimes`` strategies in
``hypothesis.extra.datetimes`` are deprecated in favor of the new
core strategies, which are more flexible and have no dependencies.
.. _v3.10.0:
-------------------
3.10.0 - 2017-05-22
-------------------
Hypothesis now uses :func:`python:inspect.getfullargspec` internally.
On Python 2, there are no visible changes.
On Python 3 :func:`@given <hypothesis.given>` and :func:`@composite <hypothesis.strategies.composite>`
now preserve :pep:`3107` annotations on the
decorated function. Keyword-only arguments are now either handled correctly
(e.g. :func:`@composite <hypothesis.strategies.composite>`), or caught in validation instead of silently discarded
or raising an unrelated error later (e.g. :func:`@given <hypothesis.given>`).
.. _v3.9.1:
------------------
3.9.1 - 2017-05-22
------------------
This is a bugfix release: the default field mapping for a DateTimeField in the
Django extra now respects the ``USE_TZ`` setting when choosing a strategy.
.. _v3.9.0:
------------------
3.9.0 - 2017-05-19
------------------
This is feature release, expanding the capabilities of the
:func:`~hypothesis.strategies.decimals` strategy.
* The new (optional) ``places`` argument allows you to generate decimals with
a certain number of places (e.g. cents, thousandths, satoshis).
* If allow_infinity is None, setting min_bound no longer excludes positive
infinity and setting max_value no longer excludes negative infinity.
* All of ``NaN``, ``-Nan``, ``sNaN``, and ``-sNaN`` may now be drawn if
allow_nan is True, or if allow_nan is None and min_value or max_value is None.
* min_value and max_value may be given as decimal strings, e.g. ``"1.234"``.
.. _v3.8.5:
------------------
3.8.5 - 2017-05-16
------------------
Hypothesis now imports :mod:`python:sqlite3` when a SQLite database is used, rather
than at module load, improving compatibility with Python implementations
compiled without SQLite support (such as BSD or Jython).
.. _v3.8.4:
------------------
3.8.4 - 2017-05-16
------------------
This is a compatibility bugfix release. :func:`~hypothesis.strategies.sampled_from`
no longer raises a deprecation warning when sampling from an
:class:`python:enum.Enum`, as all enums have a reliable iteration order.
.. _v3.8.3:
------------------
3.8.3 - 2017-05-09
------------------
This release removes a version check for older versions of :pypi:`pytest` when using
the Hypothesis pytest plugin. The pytest plugin will now run unconditionally
on all versions of pytest. This breaks compatibility with any version of pytest
prior to 2.7.0 (which is more than two years old).
The primary reason for this change is that the version check was a frequent
source of breakage when pytest change their versioning scheme. If you are not
working on pytest itself and are not running a very old version of it, this
release probably doesn't affect you.
.. _v3.8.2:
------------------
3.8.2 - 2017-04-26
------------------
This is a code reorganisation release that moves some internal test helpers
out of the main source tree so as to not have changes to them trigger releases
in future.
.. _v3.8.1:
------------------
3.8.1 - 2017-04-26
------------------
This is a documentation release. Almost all code examples are now doctests
checked in CI, eliminating stale examples.
.. _v3.8.0:
------------------
3.8.0 - 2017-04-23
------------------
This is a feature release, adding the :func:`~hypothesis.strategies.iterables` strategy, equivalent
to ``lists(...).map(iter)`` but with a much more useful repr. You can use
this strategy to check that code doesn't accidentally depend on sequence
properties such as indexing support or repeated iteration.
.. _v3.7.4:
------------------
3.7.4 - 2017-04-22
------------------
This patch fixes a bug in :ref:`3.7.3 <v3.7.3>`, where using
:obj:`@example <hypothesis.example>` and a pytest fixture in the same test
could cause the test to fail to fill the arguments, and throw a TypeError.
.. _v3.7.3:
------------------
3.7.3 - 2017-04-21
------------------
This release should include no user visible changes and is purely a refactoring
release. This modularises the behaviour of the core :func:`~hypothesis.given` function, breaking
it up into smaller and more accessible parts, but its actual behaviour should
remain unchanged.
.. _v3.7.2:
------------------
3.7.2 - 2017-04-21
------------------
This reverts an undocumented change in :ref:`3.7.1 <v3.7.1>` which broke installation on
debian stable: The specifier for the hypothesis[django] extra\_requires had
introduced a wild card, which was not supported on the default version of pip.
.. _v3.7.1:
------------------
3.7.1 - 2017-04-21
------------------
This is a bug fix and internal improvements release.
* In particular Hypothesis now tracks a tree of where it has already explored.
This allows it to avoid some classes of duplicate examples, and significantly
improves the performance of shrinking failing examples by allowing it to
skip some shrinks that it can determine can't possibly work.
* Hypothesis will no longer seed the global random arbitrarily unless you have
asked it to using :py:meth:`~hypothesis.strategies.random_module`
* Shrinking would previously have not worked correctly in some special cases
on Python 2, and would have resulted in suboptimal examples.
.. _v3.7.0:
------------------
3.7.0 - 2017-03-20
------------------
This is a feature release.
New features:
* Rule based stateful testing now has an :func:`@invariant <hypothesis.stateful.invariant>` decorator that specifies
methods that are run after init and after every step, allowing you to
encode properties that should be true at all times. Thanks to Tom Prince for
this feature.
* The :func:`~hypothesis.strategies.decimals` strategy now supports ``allow_nan`` and ``allow_infinity`` flags.
* There are :ref:`significantly more strategies available for numpy <hypothesis-numpy>`, including for
generating arbitrary data types. Thanks to Zac Hatfield Dodds for this
feature.
* When using the :func:`~hypothesis.strategies.data` strategy you can now add a label as an argument to
``draw()``, which will be printed along with the value when an example fails.
Thanks to Peter Inglesby for this feature.
Bug fixes:
* Bug fix: :func:`~hypothesis.strategies.composite` now preserves functions' docstrings.
* The build is now reproducible and doesn't depend on the path you build it
from. Thanks to Chris Lamb for this feature.
* numpy strategies for the void data type did not work correctly. Thanks to
Zac Hatfield Dodds for this fix.
There have also been a number of performance optimizations:
* The :func:`~hypothesis.strategies.permutations` strategy is now significantly faster to use for large
lists (the underlying algorithm has gone from O(n^2) to O(n)).
* Shrinking of failing test cases should have got significantly faster in
some circumstances where it was previously struggling for a long time.
* Example generation now involves less indirection, which results in a small
speedup in some cases (small enough that you won't really notice it except in
pathological cases).
.. _v3.6.1:
------------------
3.6.1 - 2016-12-20
------------------
This release fixes a dependency problem and makes some small behind the scenes
improvements.
* The fake-factory dependency was renamed to faker. If you were depending on
it through hypothesis[django] or hypothesis[fake-factory] without pinning it
yourself then it would have failed to install properly. This release changes
it so that hypothesis[fakefactory] (which can now also be installed as
hypothesis[faker]) will install the renamed faker package instead.
* This release also removed the dependency of hypothesis[django] on
hypothesis[fakefactory] - it was only being used for emails. These now use
a custom strategy that isn't from fakefactory. As a result you should also
see performance improvements of tests which generated User objects or other
things with email fields, as well as better shrinking of email addresses.
* The distribution of code using nested calls to :func:`~hypothesis.strategies.one_of` or the ``|`` operator for
combining strategies has been improved, as branches are now flattened to give
a more uniform distribution.
* Examples using :func:`~hypothesis.strategies.composite` or |.flatmap| should now shrink better. In particular
this will affect things which work by first generating a length and then
generating that many items, which have historically not shrunk very well.
.. _v3.6.0:
------------------
3.6.0 - 2016-10-31
------------------
This release reverts Hypothesis to its old pretty printing of lambda functions
based on attempting to extract the source code rather than decompile the bytecode.
This is unfortunately slightly inferior in some cases and may result in you
occasionally seeing things like ``lambda x: <unknown>`` in statistics reports and
strategy reprs.
This removes the dependencies on uncompyle6, xdis and spark-parser.
The reason for this is that the new functionality was based on uncompyle6, which
turns out to introduce a hidden GPLed dependency - it in turn depended on xdis,
and although the library was licensed under the MIT license, it contained some
GPL licensed source code and thus should have been released under the GPL.
My interpretation is that Hypothesis itself was never in violation of the GPL
(because the license it is under, the Mozilla Public License v2, is fully
compatible with being included in a GPL licensed work), but I have not consulted
a lawyer on the subject. Regardless of the answer to this question, adding a
GPLed dependency will likely cause a lot of users of Hypothesis to inadvertently
be in violation of the GPL.
As a result, if you are running Hypothesis 3.5.x you really should upgrade to
this release immediately.
.. _v3.5.3:
------------------
3.5.3 - 2016-10-05
------------------
This is a bug fix release.
Bugs fixed:
* If the same test was running concurrently in two processes and there were
examples already in the test database which no longer failed, Hypothesis
would sometimes fail with a FileNotFoundError (IOError on Python 2) because
an example it was trying to read was deleted before it was read. (:issue:`372`).
* Drawing from an :func:`~hypothesis.strategies.integers` strategy with both a min_value and a max_value
would reject too many examples needlessly. Now it repeatedly redraws until
satisfied. (:pull:`366`. Thanks to Calen Pennington for the contribution).
.. _v3.5.2:
------------------
3.5.2 - 2016-09-24
------------------
This is a bug fix release.
* The Hypothesis pytest plugin broke pytest support for doctests. Now it doesn't.
.. _v3.5.1:
------------------
3.5.1 - 2016-09-23
------------------
This is a bug fix release.
* Hypothesis now runs cleanly in -B and -BB modes, avoiding mixing bytes and unicode.
* :class:`python:unittest.TestCase` tests would not have shown up in the new statistics mode. Now they
do.
* Similarly, stateful tests would not have shown up in statistics and now they do.
* Statistics now print with pytest node IDs (the names you'd get in pytest verbose mode).
.. _v3.5.0:
------------------
3.5.0 - 2016-09-22
------------------
This is a feature release.
* :func:`~hypothesis.strategies.fractions` and :func:`~hypothesis.strategies.decimals` strategies now support min_value and max_value
parameters. Thanks go to Anne Mulhern for the development of this feature.
* The Hypothesis pytest plugin now supports a ``--hypothesis-show-statistics`` parameter
that gives detailed statistics about the tests that were run. Huge thanks to
Jean-Louis Fuchs and Adfinis-SyGroup for funding the development of this feature.
* There is a new :func:`~hypothesis.event` function that can be used to add custom statistics.
Additionally there have been some minor bug fixes:
* In some cases Hypothesis should produce fewer duplicate examples (this will mostly
only affect cases with a single parameter).
* :pypi:`pytest` command line parameters are now under an option group for Hypothesis (thanks
to David Keijser for fixing this)
* Hypothesis would previously error if you used :pep:`3107` function annotations on your tests under
Python 3.4.
* The repr of many strategies using lambdas has been improved to include the lambda body
(this was previously supported in many but not all cases).
.. _v3.4.2:
------------------
3.4.2 - 2016-07-13
------------------
This is a bug fix release, fixing a number of problems with the settings system:
* Test functions defined using :func:`@given <hypothesis.given>` can now be called from other threads
(:issue:`337`)
* Attempting to delete a settings property would previously have silently done
the wrong thing. Now it raises an AttributeError.
* Creating a settings object with a custom database_file parameter was silently
getting ignored and the default was being used instead. Now it's not.
.. _v3.4.1:
------------------
3.4.1 - 2016-07-07
------------------
This is a bug fix release for a single bug:
* On Windows when running two Hypothesis processes in parallel (e.g. using
:pypi:`pytest-xdist`) they could race with each other and one would raise an exception
due to the non-atomic nature of file renaming on Windows and the fact that you
can't rename over an existing file. This is now fixed.
.. _v3.4.0:
------------------
3.4.0 - 2016-05-27
------------------
This release is entirely provided by `Lucas Wiman <https://github.com/lucaswiman>`_:
Strategies constructed by the Django extra
will now respect much more of Django's validations out of the box.
Wherever possible, :meth:`~django:django.db.models.Model.full_clean` should
succeed.
In particular:
* The max_length, blank and choices kwargs are now respected.
* Add support for DecimalField.
* If a field includes validators, the list of validators are used to filter the field strategy.
.. _v3.3.0:
------------------
3.3.0 - 2016-05-27
------------------
This release went wrong and is functionally equivalent to :ref:`3.2.0 <v3.2.0>`. Ignore it.
.. _v3.2.0:
------------------
3.2.0 - 2016-05-19
------------------
This is a small single-feature release:
* All tests using :func:`@given <hypothesis.given>` now fix the global random seed. This removes the health
check for that. If a non-zero seed is required for the final falsifying
example, it will be reported. Otherwise Hypothesis will assume randomization
was not a significant factor for the test and be silent on the subject. If you
use :func:`~hypothesis.strategies.random_module` this will continue to work and will always
display the seed.
.. _v3.1.3:
------------------
3.1.3 - 2016-05-01
------------------
Single bug fix release
* Another charmap problem. In :ref:`3.1.2 <v3.1.2>` :func:`~hypothesis.strategies.text` and
:func:`~hypothesis.strategies.characters` would break on systems
which had ``/tmp`` mounted on a different partition than the Hypothesis storage
directory (usually in home). This fixes that.
.. _v3.1.2:
------------------
3.1.2 - 2016-04-30
------------------
Single bug fix release:
* Anything which used a :func:`~hypothesis.strategies.text` or
:func:`~hypothesis.strategies.characters` strategy was broken on Windows
and I hadn't updated appveyor to use the new repository location so I didn't
notice. This is now fixed and windows support should work correctly.
.. _v3.1.1:
------------------
3.1.1 - 2016-04-29
------------------
Minor bug fix release.
* Fix concurrency issue when running tests that use :func:`~hypothesis.strategies.text` from multiple
processes at once (:issue:`302`, thanks to Alex Chan).
* Improve performance of code using :func:`~hypothesis.strategies.lists` with max_size (thanks to
Cristi Cobzarenco).
* Fix install on Python 2 with ancient versions of pip so that it installs the
:pypi:`enum34` backport (thanks to Donald Stufft for telling me how to do this).
* Remove duplicated __all__ exports from hypothesis.strategies (thanks to
Piët Delport).
* Update headers to point to new repository location.
* Allow use of strategies that can't be used in ``find()``
(e.g. ``choices()``) in stateful testing.
.. _v3.1.0:
------------------
3.1.0 - 2016-03-06
------------------
* Add a :func:`~hypothesis.strategies.nothing` strategy that never successfully generates values.
* :func:`~hypothesis.strategies.sampled_from` and :func:`~hypothesis.strategies.one_of`
can both now be called with an empty argument
list, in which case they also never generate any values.
* :func:`~hypothesis.strategies.one_of` may now be called with a single argument that is a collection of strategies
as well as as varargs.
* Add a :func:`~hypothesis.strategies.runner` strategy which returns the instance of the current test object
if there is one.
* 'Bundle' for RuleBasedStateMachine is now a normal(ish) strategy and can be used
as such.
* Tests using RuleBasedStateMachine should now shrink significantly better.
* Hypothesis now uses a pretty-printing library internally, compatible with IPython's
pretty printing protocol (actually using the same code). This may improve the quality
of output in some cases.
* Add a 'phases' setting that allows more fine grained control over which parts of the
process Hypothesis runs
* Add a suppress_health_check setting which allows you to turn off specific health checks
in a fine grained manner.
* Fix a bug where lists of non fixed size would always draw one more element than they
included. This mostly didn't matter, but if would cause problems with empty strategies
or ones with side effects.
* Add a mechanism to the Django model generator to allow you to explicitly request the
default value (thanks to Jeremy Thurgood for this one).
.. _v3.0.5:
------------------
3.0.5 - 2016-02-25
------------------
* Fix a bug where Hypothesis would now error on :pypi:`pytest` development versions.
.. _v3.0.4:
------------------
3.0.4 - 2016-02-24
------------------
* Fix a bug where Hypothesis would error when running on Python 2.7.3 or
earlier because it was trying to pass a :class:`python:bytearray` object
to :func:`python:struct.unpack` (which is only supported since 2.7.4).
.. _v3.0.3:
------------------
3.0.3 - 2016-02-23
------------------
* Fix version parsing of pytest to work with pytest release candidates
* More general handling of the health check problem where things could fail because
of a cache miss - now one "free" example is generated before the start of the
health check run.
.. _v3.0.2:
------------------
3.0.2 - 2016-02-18
------------------
* Under certain circumstances, strategies involving :func:`~hypothesis.strategies.text` buried inside some
other strategy (e.g. ``text().filter(...)`` or ``recursive(text(), ...))`` would cause
a test to fail its health checks the first time it ran. This was caused by having
to compute some related data and cache it to disk. On travis or anywhere else
where the ``.hypothesis`` directory was recreated this would have caused the tests
to fail their health check on every run. This is now fixed for all the known cases,
although there could be others lurking.
.. _v3.0.1:
------------------
3.0.1 - 2016-02-18
------------------
* Fix a case where it was possible to trigger an "Unreachable" assertion when
running certain flaky stateful tests.
* Improve shrinking of large stateful tests by eliminating a case where it was
hard to delete early steps.
* Improve efficiency of drawing :func:`binary(min_size=n, max_size=n) <hypothesis.strategies.binary>` significantly by
provide a custom implementation for fixed size blocks that can bypass a lot
of machinery.
* Set default home directory based on the current working directory at the
point Hypothesis is imported, not whenever the function first happens to be
called.
.. _v3.0.0:
------------------
3.0.0 - 2016-02-17
------------------
Codename: This really should have been 2.1.
Externally this looks like a very small release. It has one small breaking change
that probably doesn't affect anyone at all (some behaviour that never really worked
correctly is now outright forbidden) but necessitated a major version bump and one
visible new feature.
Internally this is a complete rewrite. Almost nothing other than the public API is
the same.
New features:
* Addition of :func:`~hypothesis.strategies.data` strategy which allows you to draw arbitrary data interactively
within the test.
* New "exploded" database format which allows you to more easily check the example
database into a source repository while supporting merging.
* Better management of how examples are saved in the database.
* Health checks will now raise as errors when they fail. It was too easy to have
the warnings be swallowed entirely.
New limitations:
* ``choices()`` and ``streaming()``
strategies may no longer be used with ``find()``. Neither may
:func:`~hypothesis.strategies.data` (this is the change that necessitated a major version bump).
Feature removal:
* The ForkingTestCase executor has gone away. It may return in some more working
form at a later date.
Performance improvements:
* A new model which allows flatmap, composite strategies and stateful testing to
perform *much* better. They should also be more reliable.
* Filtering may in some circumstances have improved significantly. This will
help especially in cases where you have lots of values with individual filters
on them, such as lists(x.filter(...)).
* Modest performance improvements to the general test runner by avoiding expensive
operations
In general your tests should have got faster. If they've instead got significantly
slower, I'm interested in hearing about it.
Data distribution:
The data distribution should have changed significantly. This may uncover bugs the
previous version missed. It may also miss bugs the previous version could have
uncovered. Hypothesis is now producing less strongly correlated data than it used
to, but the correlations are extended over more of the structure.
Shrinking:
Shrinking quality should have improved. In particular Hypothesis can now perform
simultaneous shrinking of separate examples within a single test (previously it
was only able to do this for elements of a single collection). In some cases
performance will have improved, in some cases it will have got worse but generally
shouldn't have by much.
Older versions
==============
.. _v2.0.0:
------------------
2.0.0 - 2016-01-10
------------------
Codename: A new beginning
This release cleans up all of the legacy that accrued in the course of
Hypothesis 1.0. These are mostly things that were emitting deprecation warnings
in 1.19.0, but there were a few additional changes.
In particular:
* non-strategy values will no longer be converted to strategies when used in
given or find.
* FailedHealthCheck is now an error and not a warning.
* Handling of non-ascii reprs in user types have been simplified by using raw
strings in more places in Python 2.
* given no longer allows mixing positional and keyword arguments.
* given no longer works with functions with defaults.
* given no longer turns provided arguments into defaults - they will not appear
in the argspec at all.
* the basic() strategy no longer exists.
* the n_ary_tree strategy no longer exists.
* the average_list_length setting no longer exists. Note: If you're using
using recursive() this will cause you a significant slow down. You should
pass explicit average_size parameters to collections in recursive calls.
* @rule can no longer be applied to the same method twice.
* Python 2.6 and 3.3 are no longer officially supported, although in practice
they still work fine.
This also includes two non-deprecation changes:
* given's keyword arguments no longer have to be the rightmost arguments and
can appear anywhere in the method signature.
* The max_shrinks setting would sometimes not have been respected.
.. _v1.19.0:
-------------------
1.19.0 - 2016-01-09
-------------------
Codename: IT COMES
This release heralds the beginning of a new and terrible age of Hypothesis 2.0.
It's primary purpose is some final deprecations prior to said release. The goal
is that if your code emits no warnings under this release then it will probably run
unchanged under Hypothesis 2.0 (there are some caveats to this: 2.0 will drop
support for some Python versions, and if you're using internal APIs then as usual
that may break without warning).
It does have two new features:
* New @seed() decorator which allows you to manually seed a test. This may be
harmlessly combined with and overrides the derandomize setting.
* settings objects may now be used as a decorator to fix those settings to a
particular @given test.
API changes (old usage still works but is deprecated):
* Settings has been renamed to settings (lower casing) in order to make the
decorator usage more natural.
* Functions for the storage directory that were in hypothesis.settings are now
in a new hypothesis.configuration module.
Additional deprecations:
* the average_list_length setting has been deprecated in favour of being
explicit.
* the basic() strategy has been deprecated as it is impossible to support
it under a Conjecture based model, which will hopefully be implemented at
some point in the 2.x series.
* the n_ary_tree strategy (which was never actually part of the public API)
has been deprecated.
* Passing settings or random as keyword arguments to given is deprecated (use
the new functionality instead)
Bug fixes:
* No longer emit PendingDeprecationWarning for __iter__ and StopIteration in
streaming() values.
* When running in health check mode with non strict, don't print quite so
many errors for an exception in reify.
* When an assumption made in a test or a filter is flaky, tests will now
raise Flaky instead of UnsatisfiedAssumption.
.. _v1.18.1:
-------------------
1.18.1 - 2015-12-22
-------------------
Two behind the scenes changes:
* Hypothesis will no longer write generated code to the file system. This
will improve performance on some systems (e.g. if you're using
`PythonAnywhere <https://www.pythonanywhere.com/>`_ which is running your
code from NFS) and prevent some annoying interactions with auto-restarting
systems.
* Hypothesis will cache the creation of some strategies. This can significantly
improve performance for code that uses flatmap or composite and thus has to
instantiate strategies a lot.
.. _v1.18.0:
-------------------
1.18.0 - 2015-12-21
-------------------
Features:
* Tests and find are now explicitly seeded off the global random module. This
means that if you nest one inside the other you will now get a health check
error. It also means that you can control global randomization by seeding
random.
* There is a new random_module() strategy which seeds the global random module
for you and handles things so that you don't get a health check warning if
you use it inside your tests.
* floats() now accepts two new arguments: allow\_nan and allow\_infinity. These
default to the old behaviour, but when set to False will do what the names
suggest.
Bug fixes:
* Fix a bug where tests that used text() on Python 3.4+ would not actually be
deterministic even when explicitly seeded or using the derandomize mode,
because generation depended on dictionary iteration order which was affected
by hash randomization.
* Fix a bug where with complicated strategies the timing of the initial health
check could affect the seeding of the subsequent test, which would also
render supposedly deterministic tests non-deterministic in some scenarios.
* In some circumstances flatmap() could get confused by two structurally
similar things it could generate and would produce a flaky test where the
first time it produced an error but the second time it produced the other
value, which was not an error. The same bug was presumably also possible in
composite().
* flatmap() and composite() initial generation should now be moderately faster.
This will be particularly noticeable when you have many values drawn from the
same strategy in a single run, e.g. constructs like lists(s.flatmap(f)).
Shrinking performance *may* have suffered, but this didn't actually produce
an interestingly worse result in any of the standard scenarios tested.
.. _v1.17.1:
-------------------
1.17.1 - 2015-12-16
-------------------
A small bug fix release, which fixes the fact that the 'note' function could
not be used on tests which used the @example decorator to provide explicit
examples.
.. _v1.17.0:
-------------------
1.17.0 - 2015-12-15
-------------------
This is actually the same release as 1.16.1, but 1.16.1 has been pulled because
it contains the following additional change that was not intended to be in a
patch release (it's perfectly stable, but is a larger change that should have
required a minor version bump):
* Hypothesis will now perform a series of "health checks" as part of running
your tests. These detect and warn about some common error conditions that
people often run into which wouldn't necessarily have caused the test to fail
but would cause e.g. degraded performance or confusing results.
.. _v1.16.1:
-------------------
1.16.1 - 2015-12-14
-------------------
Note: This release has been removed.
A small bugfix release that allows bdists for Hypothesis to be built
under 2.7 - the compat3.py file which had Python 3 syntax wasn't intended
to be loaded under Python 2, but when building a bdist it was. In particular
this would break running setup.py test.
.. _v1.16.0:
-------------------
1.16.0 - 2015-12-08
-------------------
There are no public API changes in this release but it includes a behaviour
change that I wasn't comfortable putting in a patch release.
* Functions from hypothesis.strategies will no longer raise InvalidArgument
on bad arguments. Instead the same errors will be raised when a test
using such a strategy is run. This may improve startup time in some
cases, but the main reason for it is so that errors in strategies
won't cause errors in loading, and it can interact correctly with things
like pytest.mark.skipif.
* Errors caused by accidentally invoking the legacy API are now much less
confusing, although still throw NotImplementedError.
* hypothesis.extra.django is 1.9 compatible.
* When tests are run with max_shrinks=0 this will now still rerun the test
on failure and will no longer print "Trying example:" before each run.
Additionally note() will now work correctly when used with max_shrinks=0.
.. _v1.15.0:
-------------------
1.15.0 - 2015-11-24
-------------------
A release with two new features.
* A 'characters' strategy for more flexible generation of text with particular
character ranges and types, kindly contributed by `Alexander Shorin <https://github.com/kxepal>`_.
* Add support for preconditions to the rule based stateful testing. Kindly
contributed by `Christopher Armstrong <https://github.com/radix>`_
.. _v1.14.0:
-------------------
1.14.0 - 2015-11-01
-------------------
New features:
* Add 'note' function which lets you include additional information in the
final test run's output.
* Add 'choices' strategy which gives you a choice function that emulates
random.choice.
* Add 'uuid' strategy that generates UUIDs'
* Add 'shared' strategy that lets you create a strategy that just generates a
single shared value for each test run
Bugs:
* Using strategies of the form streaming(x.flatmap(f)) with find or in stateful
testing would have caused InvalidArgument errors when the resulting values
were used (because code that expected to only be called within a test context
would be invoked).
.. _v1.13.0:
-------------------
1.13.0 - 2015-10-29
-------------------
This is quite a small release, but deprecates some public API functions
and removes some internal API functionality so gets a minor version bump.
* All calls to the 'strategy' function are now deprecated, even ones which
pass just a SearchStrategy instance (which is still a no-op).
* Never documented hypothesis.extra entry_points mechanism has now been removed (
it was previously how hypothesis.extra packages were loaded and has been deprecated
and unused for some time)
* Some corner cases that could previously have produced an OverflowError when simplifying
failing cases using hypothesis.extra.datetimes (or dates or times) have now been fixed.
* Hypothesis load time for first import has been significantly reduced - it used to be
around 250ms (on my SSD laptop) and now is around 100-150ms. This almost never
matters but was slightly annoying when using it in the console.
* hypothesis.strategies.randoms was previously missing from \_\_all\_\_.
.. _v1.12.0:
-------------------
1.12.0 - 2015-10-18
-------------------
* Significantly improved performance of creating strategies using the functions
from the hypothesis.strategies module by deferring the calculation of their
repr until it was needed. This is unlikely to have been an performance issue
for you unless you were using flatmap, composite or stateful testing, but for
some cases it could be quite a significant impact.
* A number of cases where the repr of strategies build from lambdas is improved
* Add dates() and times() strategies to hypothesis.extra.datetimes
* Add new 'profiles' mechanism to the settings system
* Deprecates mutability of Settings, both the Settings.default top level property
and individual settings.
* A Settings object may now be directly initialized from a parent Settings.
* @given should now give a better error message if you attempt to use it with a
function that uses destructuring arguments (it still won't work, but it will
error more clearly),
* A number of spelling corrections in error messages
* :pypi:`pytest` should no longer display the intermediate modules Hypothesis generates
when running in verbose mode
* Hypothesis should now correctly handle printing objects with non-ascii reprs
on python 3 when running in a locale that cannot handle ascii printing to
stdout.
* Add a unique=True argument to lists(). This is equivalent to
unique_by=lambda x: x, but offers a more convenient syntax.
.. _v1.11.4:
-------------------
1.11.4 - 2015-09-27
-------------------
* Hide modifications Hypothesis needs to make to sys.path by undoing them
after we've imported the relevant modules. This is a workaround for issues
cryptography experienced on windows.
* Slightly improved performance of drawing from sampled_from on large lists
of alternatives.
* Significantly improved performance of drawing from one_of or strategies
using \| (note this includes a lot of strategies internally - floats()
and integers() both fall into this category). There turned out to be a
massive performance regression introduced in 1.10.0 affecting these which
probably would have made tests using Hypothesis significantly slower than
they should have been.
.. _v1.11.3:
-------------------
1.11.3 - 2015-09-23
-------------------
* Better argument validation for datetimes() strategy - previously setting
max_year < datetime.MIN_YEAR or min_year > datetime.MAX_YEAR would not have
raised an InvalidArgument error and instead would have behaved confusingly.
* Compatibility with being run on pytest < 2.7 (achieved by disabling the
plugin).
.. _v1.11.2:
-------------------
1.11.2 - 2015-09-23
-------------------
Bug fixes:
* Settings(database=my_db) would not be correctly inherited when used as a
default setting, so that newly created settings would use the database_file
setting and create an SQLite example database.
* Settings.default.database = my_db would previously have raised an error and
now works.
* Timeout could sometimes be significantly exceeded if during simplification
there were a lot of examples tried that didn't trigger the bug.
* When loading a heavily simplified example using a basic() strategy from the
database this could cause Python to trigger a recursion error.
* Remove use of deprecated API in pytest plugin so as to not emit warning
Misc:
* hypothesis-pytest is now part of hypothesis core. This should have no
externally visible consequences, but you should update your dependencies to
remove hypothesis-pytest and depend on only Hypothesis.
* Better repr for hypothesis.extra.datetimes() strategies.
* Add .close() method to abstract base class for Backend (it was already present
in the main implementation).
.. _v1.11.1:
-------------------
1.11.1 - 2015-09-16
-------------------
Bug fixes:
* When running Hypothesis tests in parallel (e.g. using pytest-xdist) there was a race
condition caused by code generation.
* Example databases are now cached per thread so as to not use sqlite connections from
multiple threads. This should make Hypothesis now entirely thread safe.
* floats() with only min_value or max_value set would have had a very bad distribution.
* Running on 3.5, Hypothesis would have emitted deprecation warnings because of use of
inspect.getargspec
.. _v1.11.0:
-------------------
1.11.0 - 2015-08-31
-------------------
* text() with a non-string alphabet would have used the repr() of the the alphabet
instead of its contexts. This is obviously silly. It now works with any sequence
of things convertible to unicode strings.
* @given will now work on methods whose definitions contains no explicit positional
arguments, only varargs (:issue:`118`).
This may have some knock on effects because it means that @given no longer changes the
argspec of functions other than by adding defaults.
* Introduction of new @composite feature for more natural definition of strategies you'd
previously have used flatmap for.
.. _v1.10.6:
-------------------
1.10.6 - 2015-08-26
-------------------
Fix support for fixtures on Django 1.7.
.. _v1.10.4:
-------------------
1.10.4 - 2015-08-21
-------------------
Tiny bug fix release:
* If the database_file setting is set to None, this would have resulted in
an error when running tests. Now it does the same as setting database to
None.
.. _v1.10.3:
-------------------
1.10.3 - 2015-08-19
-------------------
Another small bug fix release.
* lists(elements, unique_by=some_function, min_size=n) would have raised a
ValidationError if n > Settings.default.average_list_length because it would
have wanted to use an average list length shorter than the minimum size of
the list, which is impossible. Now it instead defaults to twice the minimum
size in these circumstances.
* basic() strategy would have only ever produced at most ten distinct values
per run of the test (which is bad if you e.g. have it inside a list). This
was obviously silly. It will now produce a much better distribution of data,
both duplicated and non duplicated.
.. _v1.10.2:
-------------------
1.10.2 - 2015-08-19
-------------------
This is a small bug fix release:
* star imports from hypothesis should now work correctly.
* example quality for examples using flatmap will be better, as the way it had
previously been implemented was causing problems where Hypothesis was
erroneously labelling some examples as being duplicates.
.. _v1.10.0:
-------------------
1.10.0 - 2015-08-04
-------------------
This is just a bugfix and performance release, but it changes some
semi-public APIs, hence the minor version bump.
* Significant performance improvements for strategies which are one\_of()
many branches. In particular this included recursive() strategies. This
should take the case where you use one recursive() strategy as the base
strategy of another from unusably slow (tens of seconds per generated
example) to reasonably fast.
* Better handling of just() and sampled_from() for values which have an
incorrect \_\_repr\_\_ implementation that returns non-ASCII unicode
on Python 2.
* Better performance for flatmap from changing the internal morpher API
to be significantly less general purpose.
* Introduce a new semi-public BuildContext/cleanup API. This allows
strategies to register cleanup activities that should run once the
example is complete. Note that this will interact somewhat weirdly with
find.
* Better simplification behaviour for streaming strategies.
* Don't error on lambdas which use destructuring arguments in Python 2.
* Add some better reprs for a few strategies that were missing good ones.
* The Random instances provided by randoms() are now copyable.
* Slightly more debugging information about simplify when using a debug
verbosity level.
* Support using given for functions with varargs, but not passing arguments
to it as positional.
.. _v1.9.0:
------------------
1.9.0 - 2015-07-27
------------------
Codename: The great bundling.
This release contains two fairly major changes.
The first is the deprecation of the hypothesis-extra mechanism. From
now on all the packages that were previously bundled under it other
than hypothesis-pytest (which is a different beast and will remain
separate). The functionality remains unchanged and you can still import
them from exactly the same location, they just are no longer separate
packages.
The second is that this introduces a new way of building strategies
which lets you build up strategies recursively from other strategies.
It also contains the minor change that calling .example() on a
strategy object will give you examples that are more representative of
the actual data you'll get. There used to be some logic in there to make
the examples artificially simple but this proved to be a bad idea.
.. _v1.8.5:
------------------
1.8.5 - 2015-07-24
------------------
This contains no functionality changes but fixes a mistake made with
building the previous package that would have broken installation on
Windows.
.. _v1.8.4:
------------------
1.8.4 - 2015-07-20
------------------
Bugs fixed:
* When a call to floats() had endpoints which were not floats but merely
convertible to one (e.g. integers), these would be included in the generated
data which would cause it to generate non-floats.
* Splitting lambdas used in the definition of flatmap, map or filter over
multiple lines would break the repr, which would in turn break their usage.
.. _v1.8.3:
------------------
1.8.3 - 2015-07-20
------------------
"Falsifying example" would not have been printed when the failure came from an
explicit example.
.. _v1.8.2:
------------------
1.8.2 - 2015-07-18
------------------
Another small bugfix release:
* When using ForkingTestCase you would usually not get the falsifying example
printed if the process exited abnormally (e.g. due to os._exit).
* Improvements to the distribution of characters when using text() with a
default alphabet. In particular produces a better distribution of ascii and
whitespace in the alphabet.
.. _v1.8.1:
------------------
1.8.1 - 2015-07-17
------------------
This is a small release that contains a workaround for people who have
bad reprs returning non ascii text on Python 2.7. This is not a bug fix
for Hypothesis per se because that's not a thing that is actually supposed
to work, but Hypothesis leans more heavily on repr than is typical so it's
worth having a workaround for.
.. _v1.8.0:
------------------
1.8.0 - 2015-07-16
------------------
New features:
* Much more sensible reprs for strategies, especially ones that come from
hypothesis.strategies. These should now have as reprs python code that
would produce the same strategy.
* lists() accepts a unique_by argument which forces the generated lists to be
only contain elements unique according to some function key (which must
return a hashable value).
* Better error messages from flaky tests to help you debug things.
Mostly invisible implementation details that may result in finding new bugs
in your code:
* Sets and dictionary generation should now produce a better range of results.
* floats with bounds now focus more on 'critical values', trying to produce
values at edge cases.
* flatmap should now have better simplification for complicated cases, as well
as generally being (I hope) more reliable.
Bug fixes:
* You could not previously use assume() if you were using the forking executor.
.. _v1.7.2:
------------------
1.7.2 - 2015-07-10
------------------
This is purely a bug fix release:
* When using floats() with stale data in the database you could sometimes get
values in your tests that did not respect min_value or max_value.
* When getting a Flaky error from an unreliable test it would have incorrectly
displayed the example that caused it.
* 2.6 dependency on backports was incorrectly specified. This would only have
caused you problems if you were building a universal wheel from Hypothesis,
which is not how Hypothesis ships, so unless you're explicitly building wheels
for your dependencies and support Python 2.6 plus a later version of Python
this probably would never have affected you.
* If you use flatmap in a way that the strategy on the right hand side depends
sensitively on the left hand side you may have occasionally seen Flaky errors
caused by producing unreliable examples when minimizing a bug. This use case
may still be somewhat fraught to be honest. This code is due a major rearchitecture
for 1.8, but in the meantime this release fixes the only source of this error that
I'm aware of.
.. _v1.7.1:
------------------
1.7.1 - 2015-06-29
------------------
Codename: There is no 1.7.0.
A slight technical hitch with a premature upload means there's was a yanked
1.7.0 release. Oops.
The major feature of this release is Python 2.6 support. Thanks to Jeff Meadows
for doing most of the work there.
Other minor features
* strategies now has a permutations() function which returns a strategy
yielding permutations of values from a given collection.
* if you have a flaky test it will print the exception that it last saw before
failing with Flaky, even if you do not have verbose reporting on.
* Slightly experimental git merge script available as "python -m
hypothesis.tools.mergedbs". Instructions on how to use it in the docstring
of that file.
Bug fixes:
* Better performance from use of filter. In particular tests which involve large
numbers of heavily filtered strategies should perform a lot better.
* floats() with a negative min_value would not have worked correctly (worryingly,
it would have just silently failed to run any examples). This is now fixed.
* tests using sampled\_from would error if the number of sampled elements was smaller
than min\_satisfying\_examples.
.. _v1.6.2:
------------------
1.6.2 - 2015-06-08
------------------
This is just a few small bug fixes:
* Size bounds were not validated for values for a binary() strategy when
reading examples from the database.
* sampled\_from is now in __all__ in hypothesis.strategies
* floats no longer consider negative integers to be simpler than positive
non-integers
* Small floating point intervals now correctly count members, so if you have a
floating point interval so narrow there are only a handful of values in it,
this will no longer cause an error when Hypothesis runs out of values.
.. _v1.6.1:
------------------
1.6.1 - 2015-05-21
------------------
This is a small patch release that fixes a bug where 1.6.0 broke the use
of flatmap with the deprecated API and assumed the passed in function returned
a SearchStrategy instance rather than converting it to a strategy.
.. _v1.6.0:
------------------
1.6.0 - 2015-05-21
------------------
This is a smallish release designed to fix a number of bugs and smooth out
some weird behaviours.
* Fix a critical bug in flatmap where it would reuse old strategies. If all
your flatmap code was pure you're fine. If it's not, I'm surprised it's
working at all. In particular if you want to use flatmap with django models,
you desperately need to upgrade to this version.
* flatmap simplification performance should now be better in some cases where
it previously had to redo work.
* Fix for a bug where invalid unicode data with surrogates could be generated
during simplification (it was already filtered out during actual generation).
* The Hypothesis database is now keyed off the name of the test instead of the
type of data. This makes much more sense now with the new strategies API and
is generally more robust. This means you will lose old examples on upgrade.
* The database will now not delete values which fail to deserialize correctly,
just skip them. This is to handle cases where multiple incompatible strategies
share the same key.
* find now also saves and loads values from the database, keyed off a hash of the
function you're finding from.
* Stateful tests now serialize and load values from the database. They should have
before, really. This was a bug.
* Passing a different verbosity level into a test would not have worked entirely
correctly, leaving off some messages. This is now fixed.
* Fix a bug where derandomized tests with unicode characters in the function
body would error on Python 2.7.
.. _v1.5.0:
------------------
1.5.0 - 2015-05-14
------------------
Codename: Strategic withdrawal.
The purpose of this release is a radical simplification of the API for building
strategies. Instead of the old approach of @strategy.extend and things that
get converted to strategies, you just build strategies directly.
The old method of defining strategies will still work until Hypothesis 2.0,
because it's a major breaking change, but will now emit deprecation warnings.
The new API is also a lot more powerful as the functions for defining strategies
give you a lot of dials to turn. See :doc:`the updated data section </reference/strategies>` for
details.
Other changes:
* Mixing keyword and positional arguments in a call to @given is deprecated as well.
* There is a new setting called 'strict'. When set to True, Hypothesis will raise
warnings instead of merely printing them. Turning it on by default is inadvisable because
it means that Hypothesis minor releases can break your code, but it may be useful for
making sure you catch all uses of deprecated APIs.
* max_examples in settings is now interpreted as meaning the maximum number
of unique (ish) examples satisfying assumptions. A new setting max_iterations
which defaults to a larger value has the old interpretation.
* Example generation should be significantly faster due to a new faster parameter
selection algorithm. This will mostly show up for simple data types - for complex
ones the parameter selection is almost certainly dominated.
* Simplification has some new heuristics that will tend to cut down on cases
where it could previously take a very long time.
* timeout would previously not have been respected in cases where there were a lot
of duplicate examples. You probably wouldn't have previously noticed this because
max_examples counted duplicates, so this was very hard to hit in a way that mattered.
* A number of internal simplifications to the SearchStrategy API.
* You can now access the current Hypothesis version as hypothesis.__version__.
* A top level function is provided for running the stateful tests without the
TestCase infrastructure.
.. _v1.4.0:
------------------
1.4.0 - 2015-05-04
------------------
Codename: What a state.
The *big* feature of this release is the new and slightly experimental
stateful testing API. You can read more about that in :ref:`the appropriate section <stateful>`.
Two minor features the were driven out in the course of developing this:
* You can now set settings.max_shrinks to limit the number of times
Hypothesis will try to shrink arguments to your test. If this is set to
<= 0 then Hypothesis will not rerun your test and will just raise the
failure directly. Note that due to technical limitations if max_shrinks
is <= 0 then Hypothesis will print *every* example it calls your test
with rather than just the failing one. Note also that I don't consider
settings max_shrinks to zero a sensible way to run your tests and it
should really be considered a debug feature.
* There is a new debug level of verbosity which is even *more* verbose than
verbose. You probably don't want this.
Breakage of semi-public SearchStrategy API:
* It is now a required invariant of SearchStrategy that if u simplifies to
v then it is not the case that strictly_simpler(u, v). i.e. simplifying
should not *increase* the complexity even though it is not required to
decrease it. Enforcing this invariant lead to finding some bugs where
simplifying of integers, floats and sets was suboptimal.
* Integers in basic data are now required to fit into 64 bits. As a result
python integer types are now serialized as strings, and some types have
stopped using quite so needlessly large random seeds.
Hypothesis Stateful testing was then turned upon Hypothesis itself, which lead
to an amazing number of minor bugs being found in Hypothesis itself.
Bugs fixed (most but not all from the result of stateful testing) include:
* Serialization of streaming examples was flaky in a way that you would
probably never notice: If you generate a template, simplify it, serialize
it, deserialize it, serialize it again and then deserialize it you would
get the original stream instead of the simplified one.
* If you reduced max_examples below the number of examples already saved in
the database, you would have got a ValueError. Additionally, if you had
more than max_examples in the database all of them would have been
considered.
* @given will no longer count duplicate examples (which it never called
your function with) towards max_examples. This may result in your tests
running slower, but that's probably just because they're trying more
examples.
* General improvements to example search which should result in better
performance and higher quality examples. In particular parameters which
have a history of producing useless results will be more aggressively
culled. This is useful both because it decreases the chance of useless
examples and also because it's much faster to not check parameters which
we were unlikely to ever pick!
* integers_from and lists of types with only one value (e.g. [None]) would
previously have had a very high duplication rate so you were probably
only getting a handful of examples. They now have a much lower
duplication rate, as well as the improvements to search making this
less of a problem in the first place.
* You would sometimes see simplification taking significantly longer than
your defined timeout. This would happen because timeout was only being
checked after each *successful* simplification, so if Hypothesis was
spending a lot of time unsuccessfully simplifying things it wouldn't
stop in time. The timeout is now applied for unsuccessful simplifications
too.
* In Python 2.7, integers_from strategies would have failed during
simplification with an OverflowError if their starting point was at or
near to the maximum size of a 64-bit integer.
* flatmap and map would have failed if called with a function without a
__name__ attribute.
* If max_examples was less than min_satisfying_examples this would always
error. Now min_satisfying_examples is capped to max_examples. Note that
if you have assumptions to satisfy here this will still cause an error.
Some minor quality improvements:
* Lists of streams, flatmapped strategies and basic strategies should now
now have slightly better simplification.
.. _v1.3.0:
------------------
1.3.0 - 2015-05-22
------------------
New features:
* New verbosity level API for printing intermediate results and exceptions.
* New specifier for strings generated from a specified alphabet.
* Better error messages for tests that are failing because of a lack of enough
examples.
Bug fixes:
* Fix error where use of ForkingTestCase would sometimes result in too many
open files.
* Fix error where saving a failing example that used flatmap could error.
* Implement simplification for sampled_from, which apparently never supported
it previously. Oops.
General improvements:
* Better range of examples when using one_of or sampled_from.
* Fix some pathological performance issues when simplifying lists of complex
values.
* Fix some pathological performance issues when simplifying examples that
require unicode strings with high codepoints.
* Random will now simplify to more readable examples.
.. _v1.2.1:
------------------
1.2.1 - 2015-04-16
------------------
A small patch release for a bug in the new executors feature. Tests which require
doing something to their result in order to fail would have instead reported as
flaky.
.. _v1.2.0:
------------------
1.2.0 - 2015-04-15
------------------
Codename: Finders keepers.
A bunch of new features and improvements.
* Provide a mechanism for customizing how your tests are executed.
* Provide a test runner that forks before running each example. This allows
better support for testing native code which might trigger a segfault or a C
level assertion failure.
* Support for using Hypothesis to find examples directly rather than as just as
a test runner.
* New streaming type which lets you generate infinite lazily loaded streams of
data - perfect for if you need a number of examples but don't know how many.
* Better support for large integer ranges. You can now use integers_in_range
with ranges of basically any size. Previously large ranges would have eaten
up all your memory and taken forever.
* Integers produce a wider range of data than before - previously they would
only rarely produce integers which didn't fit into a machine word. Now it's
much more common. This percolates to other numeric types which build on
integers.
* Better validation of arguments to @given. Some situations that would
previously have caused silently wrong behaviour will now raise an error.
* Include +/- sys.float_info.max in the set of floating point edge cases that
Hypothesis specifically tries.
* Fix some bugs in floating point ranges which happen when given
+/- sys.float_info.max as one of the endpoints... (really any two floats that
are sufficiently far apart so that x, y are finite but y - x is infinite).
This would have resulted in generating infinite values instead of ones inside
the range.
.. _v1.1.1:
------------------
1.1.1 - 2015-04-07
------------------
Codename: Nothing to see here
This is just a patch release put out because it fixed some internal bugs that would
block the Django integration release but did not actually affect anything anyone could
previously have been using. It also contained a minor quality fix for floats that
I'd happened to have finished in time.
* Fix some internal bugs with object lifecycle management that were impossible to
hit with the previously released versions but broke hypothesis-django.
* Bias floating point numbers somewhat less aggressively towards very small numbers
.. _v1.1.0:
------------------
1.1.0 - 2015-04-06
------------------
Codename: No-one mention the M word.
* Unicode strings are more strongly biased towards ascii characters. Previously they
would generate all over the space. This is mostly so that people who try to
shape their unicode strings with assume() have less of a bad time.
* A number of fixes to data deserialization code that could theoretically have
caused mysterious bugs when using an old version of a Hypothesis example
database with a newer version. To the best of my knowledge a change that could
have triggered this bug has never actually been seen in the wild. Certainly
no-one ever reported a bug of this nature.
* Out of the box support for Decimal and Fraction.
* new dictionary specifier for dictionaries with variable keys.
* Significantly faster and higher quality simplification, especially for
collections of data.
* New filter() and flatmap() methods on Strategy for better ways of building
strategies out of other strategies.
* New BasicStrategy class which allows you to define your own strategies from
scratch without needing an existing matching strategy or being exposed to the
full horror or non-public nature of the SearchStrategy interface.
.. _v1.0.0:
------------------
1.0.0 - 2015-03-27
------------------
Codename: Blast-off!
There are no code changes in this release. This is precisely the 0.9.2 release
with some updated documentation.
.. _v0.9.2:
------------------
0.9.2 - 2015-03-26
------------------
Codename: T-1 days.
* floats_in_range would not actually have produced floats_in_range unless that
range happened to be (0, 1). Fix this.
.. _v0.9.1:
------------------
0.9.1 - 2015-03-25
------------------
Codename: T-2 days.
* Fix a bug where if you defined a strategy using map on a lambda then the results would not be saved in the database.
* Significant performance improvements when simplifying examples using lists, strings or bounded integer ranges.
.. _v0.9.0:
------------------
0.9.0 - 2015-03-23
------------------
Codename: The final countdown
This release could also be called 1.0-RC1.
It contains a teeny tiny bugfix, but the real point of this release is to declare
feature freeze. There will be zero functionality changes between 0.9.0 and 1.0 unless
something goes really really wrong. No new features will be added, no breaking API changes
will occur, etc. This is the final shakedown before I declare Hypothesis stable and ready
to use and throw a party to celebrate.
Bug bounty for any bugs found between now and 1.0: I will buy you a drink (alcoholic,
caffeinated, or otherwise) and shake your hand should we ever find ourselves in the
same city at the same time.
The one tiny bugfix:
* Under pypy, databases would fail to close correctly when garbage collected, leading to a memory leak and a confusing error message if you were repeatedly creating databases and not closing them. It is very unlikely you were doing this and the chances of you ever having noticed this bug are very low.
.. _v0.7.2:
------------------
0.7.2 - 2015-03-22
------------------
Codename: Hygienic macros or bust
* You can now name an argument to @given 'f' and it won't break (:issue:`38`)
* strategy_test_suite is now named strategy_test_suite as the documentation claims and not in fact strategy_test_suitee
* Settings objects can now be used as a context manager to temporarily override the default values inside their context.
.. _v0.7.1:
------------------
0.7.1 - 2015-03-21
------------------
Codename: Point releases go faster
* Better string generation by parametrizing by a limited alphabet
* Faster string simplification - previously if simplifying a string with high range unicode characters it would try every unicode character smaller than that. This was pretty pointless. Now it stops after it's a short range (it can still reach smaller ones through recursive calls because of other simplifying operations).
* Faster list simplification by first trying a binary chop down the middle
* Simultaneous simplification of identical elements in a list. So if a bug only triggers when you have duplicates but you drew e.g. [-17, -17], this will now simplify to [0, 0].
.. _v0.7.0,:
-------------------
0.7.0, - 2015-03-20
-------------------
Codename: Starting to look suspiciously real
This is probably the last minor release prior to 1.0. It consists of stability
improvements, a few usability things designed to make Hypothesis easier to try
out, and filing off some final rough edges from the API.
* Significant speed and memory usage improvements
* Add an example() method to strategy objects to give an example of the sort of data that the strategy generates.
* Remove .descriptor attribute of strategies
* Rename descriptor_test_suite to strategy_test_suite
* Rename the few remaining uses of descriptor to specifier (descriptor already has a defined meaning in Python)
.. _v0.6.0:
---------------------------------------------------------
0.6.0 - 2015-03-13
---------------------------------------------------------
Codename: I'm sorry, were you using that API?
This is primarily a "simplify all the weird bits of the API" release. As a result there are a lot of breaking changes. If
you just use @given with core types then you're probably fine.
In particular:
* Stateful testing has been removed from the API
* The way the database is used has been rendered less useful (sorry). The feature for reassembling values saved from other
tests doesn't currently work. This will probably be brought back in post 1.0.
* SpecificationMapper is no longer a thing. Instead there is an ExtMethod called strategy which you extend to specify how
to convert other types to strategies.
* Settings are now extensible so you can add your own for configuring a strategy
* MappedSearchStrategy no longer needs an unpack method
* Basically all the SearchStrategy internals have changed massively. If you implemented SearchStrategy directly rather than
using MappedSearchStrategy talk to me about fixing it.
* Change to the way extra packages work. You now specify the package. This
must have a load() method. Additionally any modules in the package will be
loaded in under hypothesis.extra
Bug fixes:
* Fix for a bug where calling falsify on a lambda with a non-ascii character
in its body would error.
Hypothesis Extra:
hypothesis-fakefactory\: An extension for using faker data in hypothesis. Depends
on fake-factory.
.. _v0.5.0:
------------------
0.5.0 - 2015-02-10
------------------
Codename: Read all about it.
Core hypothesis:
* Add support back in for pypy and python 3.2
* @given functions can now be invoked with some arguments explicitly provided. If all arguments that hypothesis would have provided are passed in then no falsification is run.
* Related to the above, this means that you can now use pytest fixtures and mark.parametrize with Hypothesis without either interfering with the other.
* Breaking change: @given no longer works for functions with varargs (varkwargs are fine). This might be added back in at a later date.
* Windows is now fully supported. A limited version (just the tests with none of the extras) of the test suite is run on windows with each commit so it is now a first class citizen of the Hypothesis world.
* Fix a bug for fuzzy equality of equal complex numbers with different reprs (this can happen when one coordinate is zero). This shouldn't affect users - that feature isn't used anywhere public facing.
* Fix generation of floats on windows and 32-bit builds of python. I was using some struct.pack logic that only worked on certain word sizes.
* When a test times out and hasn't produced enough examples this now raises a Timeout subclass of Unfalsifiable.
* Small search spaces are better supported. Previously something like a @given(bool, bool) would have failed because it couldn't find enough examples. Hypothesis is now aware of the fact that these are small search spaces and will not error in this case.
* Improvements to parameter search in the case of hard to satisfy assume. Hypothesis will now spend less time exploring parameters that are unlikely to provide anything useful.
* Increase chance of generating "nasty" floats
* Fix a bug that would have caused unicode warnings if you had a sampled_from that was mixing unicode and byte strings.
* Added a standard test suite that you can use to validate a custom strategy you've defined is working correctly.
Hypothesis extra:
First off, introducing Hypothesis extra packages!
These are packages that are separated out from core Hypothesis because they have one or more dependencies. Every
hypothesis-extra package is pinned to a specific point release of Hypothesis and will have some version requirements
on its dependency. They use entry_points so you will usually not need to explicitly import them, just have them installed
on the path.
This release introduces two of them:
hypothesis-datetime:
Does what it says on the tin: Generates datetimes for Hypothesis. Just install the package and datetime support will start
working.
Depends on pytz for timezone support
hypothesis-pytest:
A very rudimentary pytest plugin. All it does right now is hook the display of falsifying examples into pytest reporting.
Depends on pytest.
.. _v0.4.3:
------------------
0.4.3 - 2015-02-05
------------------
Codename: TIL narrow Python builds are a thing
This just fixes the one bug.
* Apparently there is such a thing as a "narrow python build" and OS X ships with these by default
for python 2.7. These are builds where you only have two bytes worth of unicode. As a result,
generating unicode was completely broken on OS X. Fix this by only generating unicode codepoints
in the range supported by the system.
.. _v0.4.2:
------------------
0.4.2 - 2015-02-04
------------------
Codename: O(dear)
This is purely a bugfix release:
* Provide sensible external hashing for all core types. This will significantly improve
performance of tracking seen examples which happens in literally every falsification
run. For Hypothesis fixing this cut 40% off the runtime of the test suite. The behaviour
is quadratic in the number of examples so if you're running the default configuration
this will be less extreme (Hypothesis's test suite runs at a higher number of examples
than default), but you should still see a significant improvement.
* Fix a bug in formatting of complex numbers where the string could get incorrectly truncated.
.. _v0.4.1:
------------------
0.4.1 - 2015-02-03
------------------
Codename: Cruel and unusual edge cases
This release is mostly about better test case generation.
Enhancements:
* Has a cool release name
* text_type (str in python 3, unicode in python 2) example generation now
actually produces interesting unicode instead of boring ascii strings.
* floating point numbers are generated over a much wider range, with particular
attention paid to generating nasty numbers - nan, infinity, large and small
values, etc.
* examples can be generated using pieces of examples previously saved in the
database. This allows interesting behaviour that has previously been discovered
to be propagated to other examples.
* improved parameter exploration algorithm which should allow it to more reliably
hit interesting edge cases.
* Timeout can now be disabled entirely by setting it to any value <= 0.
Bug fixes:
* The descriptor on a OneOfStrategy could be wrong if you had descriptors which
were equal but should not be coalesced. e.g. a strategy for one_of((frozenset({int}), {int}))
would have reported its descriptor as {int}. This is unlikely to have caused you
any problems
* If you had strategies that could produce NaN (which float previously couldn't but
e.g. a Just(float('nan')) could) then this would have sent hypothesis into an infinite
loop that would have only been terminated when it hit the timeout.
* Given elements that can take a long time to minimize, minimization of floats or tuples
could be quadratic or worse in the that value. You should now see much better performance
for simplification, albeit at some cost in quality.
Other:
* A lot of internals have been been rewritten. This shouldn't affect you at all, but
it opens the way for certain of hypothesis's oddities to be a lot more extensible by
users. Whether this is a good thing may be up for debate...
.. _v0.4.0:
------------------
0.4.0 - 2015-01-21
------------------
FLAGSHIP FEATURE: Hypothesis now persists examples for later use. It stores
data in a local SQLite database and will reuse it for all tests of the same
type.
LICENSING CHANGE: Hypothesis is now released under the Mozilla Public License
2.0. This applies to all versions from 0.4.0 onwards until further notice.
The previous license remains applicable to all code prior to 0.4.0.
Enhancements:
* Printing of failing examples. I was finding that the pytest runner was not
doing a good job of displaying these, and that Hypothesis itself could do
much better.
* Drop dependency on six for cross-version compatibility. It was easy
enough to write the shim for the small set of features that we care about
and this lets us avoid a moderately complex dependency.
* Some improvements to statistical distribution of selecting from small (<=
3 elements)
* Improvements to parameter selection for finding examples.
Bugs fixed:
* could_have_produced for lists, dicts and other collections would not have
examined the elements and thus when using a union of different types of
list this could result in Hypothesis getting confused and passing a value
to the wrong strategy. This could potentially result in exceptions being
thrown from within simplification.
* sampled_from would not work correctly on a single element list.
* Hypothesis could get *very* confused by values which are
equal despite having different types being used in descriptors. Hypothesis
now has its own more specific version of equality it uses for descriptors
and tracking. It is always more fine grained than Python equality: Things
considered != are not considered equal by hypothesis, but some things that
are considered == are distinguished. If your test suite uses both frozenset
and set tests this bug is probably affecting you.
.. _v0.3.2:
------------------
0.3.2 - 2015-01-16
------------------
* Fix a bug where if you specified floats_in_range with integer arguments
Hypothesis would error in example simplification.
* Improve the statistical distribution of the floats you get for the
floats_in_range strategy. I'm not sure whether this will affect users in
practice but it took my tests for various conditions from flaky to rock
solid so it at the very least improves discovery of the artificial cases
I'm looking for.
* Improved repr() for strategies and RandomWithSeed instances.
* Add detection for flaky test cases where hypothesis managed to find an
example which breaks it but on the final invocation of the test it does
not raise an error. This will typically happen with too much recursion
errors but could conceivably happen in other circumstances too.
* Provide a "derandomized" mode. This allows you to run hypothesis with
zero real randomization, making your build nice and deterministic. The
tests run with a seed calculated from the function they're testing so you
should still get a good distribution of test cases.
* Add a mechanism for more conveniently defining tests which just sample
from some collection.
* Fix for a really subtle bug deep in the internals of the strategy table.
In some circumstances if you were to define instance strategies for both
a parent class and one or more of its subclasses you would under some
circumstances get the strategy for the wrong superclass of an instance.
It is very unlikely anyone has ever encountered this in the wild, but it
is conceivably possible given that a mix of namedtuple and tuple are used
fairly extensively inside hypothesis which do exhibit this pattern of
strategy.
.. _v0.3.1:
------------------
0.3.1 - 2015-01-13
------------------
* Support for generation of frozenset and Random values
* Correct handling of the case where a called function mutates it argument.
This involved introducing a notion of a strategies knowing how to copy
their argument. The default method should be entirely acceptable and the
worst case is that it will continue to have the old behaviour if you
don't mark your strategy as mutable, so this shouldn't break anything.
* Fix for a bug where some strategies did not correctly implement
could_have_produced. It is very unlikely that any of these would have
been seen in the wild, and the consequences if they had been would have
been minor.
* Re-export the @given decorator from the main hypothesis namespace. It's
still available at the old location too.
* Minor performance optimisation for simplifying long lists.
.. _v0.3.0:
------------------
0.3.0 - 2015-01-12
------------------
* Complete redesign of the data generation system. Extreme breaking change
for anyone who was previously writing their own SearchStrategy
implementations. These will not work any more and you'll need to modify
them.
* New settings system allowing more global and modular control of Verifier
behaviour.
* Decouple SearchStrategy from the StrategyTable. This leads to much more
composable code which is a lot easier to understand.
* A significant amount of internal API renaming and moving. This may also
break your code.
* Expanded available descriptors, allowing for generating integers or
floats in a specific range.
* Significantly more robust. A very large number of small bug fixes, none
of which anyone is likely to have ever noticed.
* Deprecation of support for pypy and python 3 prior to 3.3. 3.3 and 3.4.
Supported versions are 2.7.x, 3.3.x, 3.4.x. I expect all of these to
remain officially supported for a very long time. I would not be
surprised to add pypy support back in later but I'm not going to do so
until I know someone cares about it. In the meantime it will probably
still work.
.. _v0.2.2:
------------------
0.2.2 - 2015-01-08
------------------
* Fix an embarrassing complete failure of the installer caused by my being
bad at version control
.. _v0.2.1:
------------------
0.2.1 - 2015-01-07
------------------
* Fix a bug in the new stateful testing feature where you could make
__init__ a @requires method. Simplification would not always work if the
prune method was able to successfully shrink the test.
.. _v0.2.0:
------------------
0.2.0 - 2015-01-07
------------------
* It's aliiive.
* Improve python 3 support using six.
* Distinguish between byte and unicode types.
* Fix issues where FloatStrategy could raise.
* Allow stateful testing to request constructor args.
* Fix for issue where test annotations would timeout based on when the
module was loaded instead of when the test started
.. _v0.1.4:
------------------
0.1.4 - 2013-12-14
------------------
* Make verification runs time bounded with a configurable timeout
.. _v0.1.3:
------------------
0.1.3 - 2013-05-03
------------------
* Bugfix: Stateful testing behaved incorrectly with subclassing.
* Complex number support
* support for recursive strategies
* different error for hypotheses with unsatisfiable assumptions
.. _v0.1.2:
------------------
0.1.2 - 2013-03-24
------------------
* Bugfix: Stateful testing was not minimizing correctly and could
throw exceptions.
* Better support for recursive strategies.
* Support for named tuples.
* Much faster integer generation.
.. _v0.1.1:
------------------
0.1.1 - 2013-03-24
------------------
* Python 3.x support via 2to3.
* Use new style classes (oops).
.. _v0.1.0:
------------------
0.1.0 - 2013-03-23
------------------
* Introduce stateful testing.
* Massive rewrite of internals to add flags and strategies.
.. _v0.0.5:
------------------
0.0.5 - 2013-03-13
------------------
* No changes except trying to fix packaging
.. _v0.0.4:
------------------
0.0.4 - 2013-03-13
------------------
* No changes except that I checked in a failing test case for 0.0.3
so had to replace the release. Doh
.. _v0.0.3:
------------------
0.0.3 - 2013-03-13
------------------
* Improved a few internals.
* Opened up creating generators from instances as a general API.
* Test integration.
.. _v0.0.2:
------------------
0.0.2 - 2013-03-12
------------------
* Starting to tighten up on the internals.
* Change API to allow more flexibility in configuration.
* More testing.
.. _v0.0.1:
------------------
0.0.1 - 2013-03-10
------------------
* Initial release.
* Basic working prototype. Demonstrates idea, probably shouldn't be used.
|