This reverts commit a357cc4e1a.
We no longer need the tests to change---I was able to fix the order by
bringing the "abort" action into the standard list of options.
Related to #1966. Previously, we used a `syspath` call inside MediaFile, which
probably wasn't right: the constructor should behave like `open` in that we
need to use pass an OS path.
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
* Call AutotagStub.restore() during the tearDown of
test_mbsubmit.MBSubmitPluginTest and test_plugins.PromptChoicesTest,
which could potentially lead to other tests calling mocked versions
of autotag.mb.match_album, .match_track, .album_for_id and .track_for_id
instead of the real functions.
* Add "before_choose_candidate" unit tests (PromptChoicesTest), containing
tests for checking the addition of choices to ui.input_options (album and
singletons), conflict resolution, and callback handling (regular and with
return value).
An event listener that expects too few arguments won't crash, arguments
will be cut off instead. This restores a backwards-compatibility hack
that was removed in commit 327b62b6.
Delete the remaining usages of BeetsPlugin.listen().
Since BeetsPlugin.listeners are wrapped by a loglevel-setting function,
we cannot easily check their unicity anymore.
BeetsPlugin._raw_listeners set holds the raw listeners.
Legacy plugins that did not handle enough arguments in their listenings
functions may break: dedicated code is now deleted for it would not work
with the decorated listeners.
Tests got fixed. Some modifications were done empirically: if it passes
then it's okay.
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.