summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-03-31 11:40:20 -0400
committerR David Murray <rdmurray@bitdance.com>2011-03-31 11:40:20 -0400
commit28346b8077ca89b8ad4eec2a51ab626ce646b7ed (patch)
tree2a485dbf0aefcf5de9b7d553240d845b7ad7f4e4
parentdd810ddb65870875e0312c04adcf2275ffbd0e17 (diff)
downloadcpython-git-28346b8077ca89b8ad4eec2a51ab626ce646b7ed.tar.gz
Only a few files were opened using findfile; consistently don't use it.
-rw-r--r--Lib/test/test_email/test_email.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index 6cefa38f16..27356664ce 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -36,7 +36,7 @@ from email import iterators
from email import base64mime
from email import quoprimime
-from test.support import findfile, run_unittest, unlink
+from test.support import run_unittest, unlink
from test.test_email import __file__ as landmark
@@ -65,7 +65,7 @@ class TestEmailBase(unittest.TestCase):
raise self.failureException(NL + NL.join(diff))
def _msgobj(self, filename):
- with openfile(findfile(filename)) as fp:
+ with openfile(filename) as fp:
return email.message_from_file(fp)
@@ -194,7 +194,7 @@ class TestMessageAPI(TestEmailBase):
def test_message_rfc822_only(self):
# Issue 7970: message/rfc822 not in multipart parsed by
# HeaderParser caused an exception when flattened.
- with openfile(findfile('msg_46.txt')) as fp:
+ with openfile('msg_46.txt') as fp:
msgdata = fp.read()
parser = HeaderParser()
msg = parser.parsestr(msgdata)
@@ -1055,13 +1055,7 @@ Blah blah blah
# Test the basic MIMEAudio class
class TestMIMEAudio(unittest.TestCase):
def setUp(self):
- # Make sure we pick up the audiotest.au that lives in email/test/data.
- # In Python, there's an audiotest.au living in Lib/test but that isn't
- # included in some binary distros that don't include the test
- # package. The trailing empty string on the .join() is significant
- # since findfile() will do a dirname().
- datadir = os.path.join(os.path.dirname(landmark), 'data', '')
- with open(findfile('audiotest.au', datadir), 'rb') as fp:
+ with openfile('audiotest.au', 'rb') as fp:
self._audiodata = fp.read()
self._au = MIMEAudio(self._audiodata)
@@ -4320,7 +4314,7 @@ Content-Type: application/x-foo;
class TestSigned(TestEmailBase):
def _msg_and_obj(self, filename):
- with openfile(findfile(filename)) as fp:
+ with openfile(filename) as fp:
original = fp.read()
msg = email.message_from_string(original)
return original, msg