def test_rmtree(tmpdir): d = tmpdir for _ in range(80): # https://bugs.python.org/issue18199 d /= 'a' d.mkdir() (d / 'a.ini').write_text('a', encoding='utf-8') root = tmpdir / 'a' assert root.exists() rmtree(str(root)) assert not root.exists()
def test_rmtree(self): comps = [] for i in range(100): comps.append('a') d = self.tmp_path(*comps) d.mkdir() f = d.joinpath('a.ini') with f.open('w', encoding='utf8') as fp: fp.write('a') assert self.tmp_path('a').exists() rmtree(self.tmp_path('a')) assert not self.tmp_path('a').exists()