Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.
Goal is smoothing the transition to python 3.
The conversion function either copies files or runs the conversion
command on them, depending on the result of the `should_transcode()`
function. This commit makes the tests more sensitive to these cases.
* Each test function only uses on fixture, so we create fixtures in the
test functions and not in the `setup()` method.
* We test the effect of the option set to true and false.
When set to true, this config option chooses copying over converting when the
source file is in a lossy format. At the moment, everything except ape, flac,
alac and wav is considered lossy.
This option allows the user to specify the format on the command line
instead of editing the configuration.
The commit also includes some refactoring. In particular adding
arguments to functions to avoid dependence on global state.
Doc and Changelog in next commit
Doing test-specific cleanup in tearDown before general sandbox deletion helps
avoiding contamination of global state between tests when cleanup fails.
Current Windows status:
Ran 1106 tests in 72.373s
FAILED (SKIP=10, errors=13, failures=15)
Closer!
* `encode()` raises an error when the command returns with non-zero exit
status. We catch that in the higher-level conversion functions and skip to
the next item without writing tags.
* Simplified the handling of the `keep_new` flag.