Skip to content

Commit

Permalink
Try to make a test more reliable
Browse files Browse the repository at this point in the history
As @arcresu pointed out on Gitter, this openSUSE patch adds a safeguard
to this test, which was apparently failing for them:
https://build.opensuse.org/package/view_file/openSUSE:Factory/beets/fix_test_command_line_option_relative_to_working_dir.diff?expand=1

Reading the configuration once here to make sure that we're in a clean
state seems harmless enough. The culprit is likely that a previous test
was modifying the configuration and not properly cleaning up. This
change defends against that kind of mistake.
  • Loading branch information
sampsyo committed Jun 3, 2019
1 parent 94b38ee commit 5a3157d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ For packagers:
called `Confuse`_, released as :pypi:`confuse`. Beets now depends on this
package. Confuse has existed separately for some time and is used by
unrelated projects, but until now we've been bundling a copy within beets.
* We attempted to fix an unreliable test, so a patch to `skip <https://sources.debian.org/src/beets/1.4.7-2/debian/patches/skip-broken-test/>`_
or `repair <https://build.opensuse.org/package/view_file/openSUSE:Factory/beets/fix_test_command_line_option_relative_to_working_dir.diff?expand=1>`_
the test may no longer be necessary.

.. _MediaFile: https://github.com/beetbox/mediafile
.. _Confuse: https://github.com/beetbox/confuse
Expand Down
1 change: 1 addition & 0 deletions test/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ def test_cli_config_paths_resolve_relative_to_beetsdir(self):
)

def test_command_line_option_relative_to_working_dir(self):
config.read()
os.chdir(self.temp_dir)
self.run_command('--library', 'foo.db', 'test', lib=None)
self.assert_equal_path(config['library'].as_filename(),
Expand Down

0 comments on commit 5a3157d

Please sign in to comment.