I thought py.test
is \"standalone\" in a sense that it treats test_*.py
files \"as it is\", and only imports modules specified in these files, with
I really suggest you to rename the directory to something not called "distutils". Why ? Because you are overriding an existing module. When "import distutils" or "from distutils import *" appear in the script (from another import or your own python file), it will prefer your directory instead the system one. If the module distutils have been already loaded before, your distutils will not be loaded, because the symbol already exists in global().
It would be really simpler to rename that directory (like tests) instead of trying to fight with py.text / python internals.