mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Merge pull request #3277 from beetbox/arcresu-patch-3
Setup path correctly in testall.py
This commit is contained in:
commit
4fc9e2686b
1 changed files with 3 additions and 4 deletions
|
|
@ -22,16 +22,15 @@ import re
|
|||
import sys
|
||||
import unittest
|
||||
|
||||
pkgpath = os.path.dirname(__file__) or '.'
|
||||
sys.path.append(pkgpath)
|
||||
os.chdir(pkgpath)
|
||||
pkgpath = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) or '..'
|
||||
sys.path.insert(0, pkgpath)
|
||||
|
||||
|
||||
def suite():
|
||||
s = unittest.TestSuite()
|
||||
# Get the suite() of every module in this directory beginning with
|
||||
# "test_".
|
||||
for fname in os.listdir(pkgpath):
|
||||
for fname in os.listdir(os.path.join(pkgpath, 'test')):
|
||||
match = re.match(r'(test_\S+)\.py$', fname)
|
||||
if match:
|
||||
modname = match.group(1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue