tests: remove import path mangling while importing 'test._common'

The import path mangling is not relevant (anymore?) for the two
ways of running tests:

* `python3 test/testall.py` (see CONTRIBUTING.rst):
  The `testall.py` script already adds the project path to `sys.path`.
* `tox -e py-cov`: this command is supposed to be run from the project
  path. Thus, the current directory is already the first of location
  in `sys.path`.

The previous mangling of the import path while loading a module could
lead to unwanted side-effects hidden in an unexpected location.
Instead, import path mangling should take place in the script being
called by the user (here: `testall.py`).
This commit is contained in:
Lars Kruse 2024-01-04 04:00:09 +01:00
parent 7df14b6b3f
commit 4c2362b361

View file

@ -22,8 +22,6 @@ import time
import unittest
from contextlib import contextmanager
# Mangle the search path to include the beets sources.
sys.path.insert(0, "..")
import beets # noqa: E402
import beets.library # noqa: E402