diff --git a/beets/test/_common.py b/beets/test/_common.py index 0d2d51f1e..ca1671cb7 100644 --- a/beets/test/_common.py +++ b/beets/test/_common.py @@ -18,7 +18,6 @@ import os import sys import unittest from contextlib import contextmanager -from pathlib import Path import beets import beets.library @@ -115,11 +114,6 @@ def import_session(lib=None, loghandler=None, paths=[], query=[], cli=False): class Assertions: """A mixin with additional unit test assertions.""" - def assertIsDir(self, path): - path = Path(os.fsdecode(path)) - assert path.exists() - assert path.is_dir() - def assert_equal_path(self, a, b): """Check that two paths are equal.""" a_bytes, b_bytes = util.normpath(a), util.normpath(b) diff --git a/test/test_files.py b/test/test_files.py index 266e4f4d0..8b08a3fab 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -671,12 +671,9 @@ class UniquePathTest(BeetsTestCase): class MkDirAllTest(BeetsTestCase): - def test_parent_exists(self): - path = self.temp_dir_path / "foo" / "bar" / "baz" / "qux.mp3" - util.mkdirall(path) - self.assertIsDir(self.temp_dir_path / "foo" / "bar" / "baz") - - def test_child_does_not_exist(self): - path = self.temp_dir_path / "foo" / "bar" / "baz" / "qux.mp3" - util.mkdirall(path) - assert not path.exists() + def test_mkdirall(self): + child = self.temp_dir_path / "foo" / "bar" / "baz" / "quz.mp3" + util.mkdirall(child) + assert not child.exists() + assert child.parent.exists() + assert child.parent.is_dir() diff --git a/test/test_importer.py b/test/test_importer.py index 521f98f99..a072d43d4 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -411,7 +411,7 @@ class ImportTest(PathsMixin, AutotagImportTestCase): assert not self.lib.items() def test_skip_non_album_dirs(self): - self.assertIsDir(os.path.join(self.import_dir, b"album")) + assert (self.import_path / "album").exists() self.touch(b"cruft", dir=self.import_dir) self.importer.add_choice(importer.Action.APPLY) self.importer.run()