Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f29ffbd

Browse files
committed
TestMIMEAudio.setUp(): Use the email package's copy of the audio test
file, needed because some binary distros (read RPMs) don't include the test module in their standard Python package. This eliminates an external dependency and closes SF bug # 650441.
1 parent c99c08c commit f29ffbd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/email/test/test_email.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,13 @@ def test_dont_mangle_from(self):
769769
# Test the basic MIMEAudio class
770770
class TestMIMEAudio(unittest.TestCase):
771771
def setUp(self):
772-
# In Python, audiotest.au lives in Lib/test not Lib/test/data
773-
fp = open(findfile('audiotest.au'), 'rb')
772+
# Make sure we pick up the audiotest.au that lives in email/test/data.
773+
# In Python, there's an audiotest.au living in Lib/test but that isn't
774+
# included in some binary distros that don't include the test
775+
# package. The trailing empty string on the .join() is significant
776+
# since findfile() will do a dirname().
777+
datadir = os.path.join(os.path.dirname(landmark), 'data', '')
778+
fp = open(findfile('audiotest.au', datadir), 'rb')
774779
try:
775780
self._audiodata = fp.read()
776781
finally:

0 commit comments

Comments
 (0)