diff --git a/beets/util/confit.py b/beets/util/confit.py deleted file mode 100644 index db72d8b8c..000000000 --- a/beets/util/confit.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file is part of beets. -# Copyright 2016-2019, Adrian Sampson. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. - - -import warnings - -import confuse - -warnings.warn( - "beets.util.confit is deprecated; use confuse instead", - # Show the location of the `import confit` statement as the warning's - # source, rather than this file, such that the offending module can be - # identified easily. - stacklevel=2, -) - -# Import everything from the confuse module into this module. -for key, value in confuse.__dict__.items(): - if key not in ["__name__"]: - globals()[key] = value - - -# Cleanup namespace. -del key, value, warnings, confuse diff --git a/test/test_util.py b/test/test_util.py index bb5d1e691..d2a7caea0 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -217,21 +217,6 @@ class PathTruncationTest(_common.TestCase): self.assertEqual(p, "abcde/f.ext") -class ConfitDeprecationTest(_common.TestCase): - def test_confit_deprecattion_warning_origin(self): - """Test that importing `confit` raises a warning. - - In addition, ensure that the warning originates from the actual - import statement, not the `confit` module. - """ - # See https://github.com/beetbox/beets/discussions/4024 - with self.assertWarns(UserWarning) as w: - import beets.util.confit # noqa: F401 - - self.assertIn(__file__, w.filename) - self.assertNotIn("confit.py", w.filename) - - def suite(): return unittest.TestLoader().loadTestsFromName(__name__)