Skip to content

Tests leave load of junk in my temp-dir #298

@lurch

Description

@lurch

Observe:

$ ls -l /tmp/tmp*
ls: cannot access /tmp/tmp*: No such file or directory
$ nosetests tests/test_tempfs.py
.......................................................................S....................................................................................S...........
----------------------------------------------------------------------
Ran 168 tests in 1.108s

OK (SKIP=2)
$ ls -l /tmp/tmp*
/tmp/tmp0_2hqgqlfstestosfs:
total 0

/tmp/tmp_0fkvyxqfstestosfs:
total 0

/tmp/tmp15_h_uavfsTempFS:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmp189jd9a_fstestosfs:
total 4
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp1i3v20tjfstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmp1l7wo6t1fstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew    3 Jun 11 02:03 file.bin
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp396gu0e5fstestosfs:
total 0

/tmp/tmp3em77scofstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 1200 Jun 11 02:03 hello.bin

/tmp/tmp_4phjqbjfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp56py379lfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 6 Jun 11 02:03 foo

/tmp/tmp5n3vws2vfstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   20 Jun 11 02:03 iter.bin

/tmp/tmp5vgpa86rfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 12 Jun 11 02:03 hello.bin

/tmp/tmp5w3s7nnrfstestosfs:
total 8
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 foo.bin

/tmp/tmp6n9c6n6nfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp6p8f1wfhfstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmp6v96q1refstestosfs:
total 4
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp6yliqrgjfstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 foo

/tmp/tmp7uvz1xbrfstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmp8zll3o76fstestosfs:
total 0

/tmp/tmpacu1rkz8fstestosfs:
total 0

/tmp/tmpb3kld447fstestosfs:
total 16
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 bar
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 baz
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo_copy

/tmp/tmpb3qvum7ffstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmp_bcvx72hfstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpc3r8nk8sfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpcgud50n1fstestosfs:
total 0

/tmp/tmpck80fzibfstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11  2019 birthday.txt

/tmp/tmpcknaa6aifsTempFS:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmpd02eaf4nfstestosfs:
total 0

/tmp/tmpd4p6j_yifstestosfs:
total 16
-rw-rw-r-- 1 andrew andrew    3 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 baz
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    3 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 notadir

/tmp/tmpda5d2rnrfstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew 12 Jun 11 02:03 bar.txt
-rw-rw-r-- 1 andrew andrew 12 Jun 11 02:03 foo.txt

/tmp/tmpdoz9qly3fstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpffgd9v02fstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 new.txt

/tmp/tmpfie7smjufsTempFS:
total 0

/tmp/tmpfo71zn9vfstestosfs:
total 16
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    5 Jun 11 02:03 foo1
-rw-rw-r-- 1 andrew andrew    5 Jun 11 02:03 foo3

/tmp/tmpfu04kylbfstestosfs:
total 0

/tmp/tmpgx1fg97ofsTempFS:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmpgye7zaqafstestosfs:
total 0

/tmp/tmph29y0x71fstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo

/tmp/tmph37u6ndafstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmphq76_4bifstestosfs:
total 4
lrwxrwxrwx 1 andrew andrew 30 Jun 11 02:03 bar -> /tmp/tmphq76_4bifstestosfs/foo
-rw-rw-r-- 1 andrew andrew  6 Jun 11 02:03 foo

/tmp/tmpht99mmtvfstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmphtnr_i0qfsTempFS:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmphuruhcv0fstestosfs:
total 0

/tmp/tmpip8msjn3fstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpjemvmm05fstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 7 Jun 11 02:03 test_openbin_exclusive

/tmp/tmpk51k477yfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpk6fgqg8ofstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmpkcoo_7w8fstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 foo

/tmp/tmpm5g0idjhfstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo1
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo2

/tmp/tmpmamlehs3fstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 384 Jun 11 02:03 foo

/tmp/tmpmm85f801fstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo2
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmpmu4ihcz8fstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 foo

/tmp/tmpn3u8wtfwfstestosfs:
total 0

/tmp/tmpn5bdc9qafstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmpnahwvf72fstestosfs:
total 8
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo2

/tmp/tmpne9qrl70fstestosfs:
total 0

/tmp/tmpnhqb_k6wfsTempFS:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpnpzk7jdqfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo

/tmp/tmponstgn0nfstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmpooreripefstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 6 Jun 11 02:03 foo

/tmp/tmpoxv06nh8fstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 $FOO
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 TYRIONLANISTER

/tmp/tmpp62860iqfstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 fOO
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 Foo

/tmp/tmpps972tg7fstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmprre9qmxyfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo

/tmp/tmpruti4s9rfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 256 Jun 11 02:03 foo

/tmp/tmpry6y7dsrfstestosfs:
total 16
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 bar
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 baz
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    4 Jun 11 02:03 foo

/tmp/tmps0pzvleqfstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jul  5  2016 birthday.txt

/tmp/tmpsdp9kws6fstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo

/tmp/tmpsherufovfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmp_sttbo_3fstestosfs:
total 0

/tmp/tmpux7008cgfstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   12 Jun 11 02:03 top.txt

/tmp/tmpu_y2r0xbfstestosfs:
total 4
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpvhegnjrffstestosfs:
total 4
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpvmsmfb5qfstestosfs:
total 0
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 foo

/tmp/tmpvqz4yw8hfstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 7 Jun 11 02:03 test_open_exclusive

/tmp/tmpvsv2kvkffstestosfs:
total 4
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 test.txt

/tmp/tmpvy9rtio3fstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 dir
-rw-rw-r-- 1 andrew andrew    3 Jun 11 02:03 foo

/tmp/tmpvzswc9xtfstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 baz
-rw-rw-r-- 1 andrew andrew  256 Jun 11 02:03 foo

/tmp/tmpwelqzllwfstestosfs:
total 12
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 egg
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo
drwxrwxr-x 3 andrew andrew 4096 Jun 11 02:03 foo2

/tmp/tmpwu9dwt0gfstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 empty
-rw-rw-r-- 1 andrew andrew    1 Jun 11 02:03 one
-rw-rw-r-- 1 andrew andrew 1000 Jun 11 02:03 onethousand

/tmp/tmpx2ophvmffstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpxdu4ss7mfstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo
-rw-rw-r-- 1 andrew andrew   20 Jun 11 02:03 iter.txt

/tmp/tmpxm_kma6rfstestosfs:
total 2312
-rw-rw-r-- 1 andrew andrew 1572864 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew    4096 Jun 11 02:03 dir1
drwxrwxr-x 3 andrew andrew    4096 Jun 11 02:03 dir2
-rw-rw-r-- 1 andrew andrew  786432 Jun 11 02:03 foo

/tmp/tmpxrb9ap8r__tempfs__:
total 4
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo

/tmp/tmpy04mawiifsTempFS:
total 0

/tmp/tmpy1jzdgtwfsTempFS:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 foo

/tmp/tmpy24v7fujfstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew  0 Jun 11 02:03 bin
-rw-rw-r-- 1 andrew andrew 10 Jun 11 02:03 text
-rw-rw-r-- 1 andrew andrew 14 Jun 11 02:03 unicode

/tmp/tmpz4lz_eo2fstestosfs:
total 4
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo

/tmp/tmpzb8g0h9sfstestosfs:
total 4
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 bar
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo.txt

/tmp/tmpzc7rfkvzfstestosfs:
total 8
-rw-rw-r-- 1 andrew andrew 3 Jun 11 02:03 foo1
-rw-rw-r-- 1 andrew andrew 4 Jun 11 02:03 foo2
-rw-rw-r-- 1 andrew andrew 0 Jun 11 02:03 newfoo

/tmp/tmpzgqa2dvrfstestosfs:
total 12
-rw-rw-r-- 1 andrew andrew    6 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 baz
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 baz2

/tmp/tmpzu50bz54fstestosfs:
total 8
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 bar
drwxrwxr-x 2 andrew andrew 4096 Jun 11 02:03 baz
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo.py
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo.pyc
-rw-rw-r-- 1 andrew andrew    0 Jun 11 02:03 foo.txt

Seems like make_fs in https://github.com/PyFilesystem/pyfilesystem2/blob/master/tests/test_osfs.py does tempfile.mkdtemp("fstestosfs") but this directory never gets deleted anywhere :( Was there supposed to be another shutil.rmtree in destroy_fs ?
I guess in some situations you may want to keep these temporary test directories for later debugging purposes, but IMHO running the unit-tests should auto-delete all these junk files by default, and only leave them behind if some kind of env-var or something is explicitly set?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions