From 6286bc0b0f8ab39529228fbe7c386efb352969fa Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Fri, 4 Apr 2014 22:38:48 +0200 Subject: [PATCH] Include site-packages on travis and skip tests otherwise --- .travis.yml | 3 ++- test/test_replaygain.py | 10 ++++++++-- tox.ini | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 809f81188..939301854 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: python -python: 2.7 +virtualenv: + system_site_packages: true branches: only: diff --git a/test/test_replaygain.py b/test/test_replaygain.py index 76ec480c8..39a765465 100644 --- a/test/test_replaygain.py +++ b/test/test_replaygain.py @@ -27,6 +27,13 @@ from beets import plugins from beets.library import Item, Album from beets.mediafile import MediaFile +try: + import gi + gi.require_version('Gst', '1.0') + GST_AVAILABLE = True +except ImportError, ValueError: + GST_AVAILABLE = False + class ReplayGainCliTestBase(object): @@ -117,8 +124,6 @@ class ReplayGainCliTestBase(object): self.assertEqual(item.rg_track_gain, 0.0) self.assertEqual(item.rg_track_peak, peak) - - def test_cli_saves_album_gain_to_file(self): for item in self.lib.items(): mediafile = MediaFile(item.path) @@ -142,6 +147,7 @@ class ReplayGainCliTestBase(object): self.assertNotEqual(max(peaks), 0.0) +@unittest.skipIf(not GST_AVAILABLE, 'gstreamer cannot be found') class ReplayGainGstCliTest(ReplayGainCliTestBase, unittest.TestCase): backend = u'gstreamer' diff --git a/tox.ini b/tox.ini index 3aef31627..ba1ab45ef 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ deps = responses commands = nosetests +sitepackages = True [testenv:py26] deps =