| 1862 | self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) |
| 1863 | |
| 1864 | def test_with_statement(self): |
| 1865 | class manager(object): |
| 1866 | def __enter__(self): |
| 1867 | return (1, 2) |
| 1868 | def __exit__(self, *args): |
| 1869 | pass |
| 1870 | |
| 1871 | with manager(): |
| 1872 | pass |
| 1873 | with manager() as x: |
| 1874 | pass |
| 1875 | with manager() as (x, y): |
| 1876 | pass |
| 1877 | with manager(), manager(): |
| 1878 | pass |
| 1879 | with manager() as x, manager() as y: |
| 1880 | pass |
| 1881 | with manager() as x, manager(): |
| 1882 | pass |
| 1883 | |
| 1884 | with ( |
| 1885 | manager() |
| 1886 | ): |
| 1887 | pass |
| 1888 | |
| 1889 | with ( |
| 1890 | manager() as x |
| 1891 | ): |
| 1892 | pass |
| 1893 | |
| 1894 | with ( |
| 1895 | manager() as (x, y), |
| 1896 | manager() as z, |
| 1897 | ): |
| 1898 | pass |
| 1899 | |
| 1900 | with ( |
| 1901 | manager(), |
| 1902 | manager() |
| 1903 | ): |
| 1904 | pass |
| 1905 | |
| 1906 | with ( |
| 1907 | manager() as x, |
| 1908 | manager() as y |
| 1909 | ): |
| 1910 | pass |
| 1911 | |
| 1912 | with ( |
| 1913 | manager() as x, |
| 1914 | manager() |
| 1915 | ): |
| 1916 | pass |
| 1917 | |
| 1918 | with ( |
| 1919 | manager() as x, |
| 1920 | manager() as y, |
| 1921 | manager() as z, |