This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Broken imports in test/test_email/torture_test.py, test_asian_codecs.py) has a broken import
Type: behavior Stage: resolved
Components: email, Tests Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: barry, imz, python-dev, r.david.murray, terry.reedy
Priority: normal Keywords:

Created on 2016-05-02 20:44 by imz, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg264667 - (view) Author: Ivan Zakharyaschev (imz) Date: 2016-05-02 20:44
(An issue similar to http://bugs.python.org/issue26911 , but with a different source file from the tests)

Lib/test/test_email/torture_test.py:15:from email.test.test_email import TestEmailBase

should be:

from test.test_email import TestEmailBase

because the first variant has a non-existing path.

(This makes the auto-requirements generator in ALT Sisyphus to generate a broken/unsatisfiable dependency on email.test.test_email when building the package from http://git.altlinux.org/people/imz/packages/python3.git .)

Similarly,

Lib/test/test_email/test_asian_codecs.py:8:from test.test_email.test_email import TestEmailBase

should better not have an extra "test_email" component in the path.

All other imports of test_email in Python 3.5.1 sources are of the form I'm suggesting:

$ git --no-pager grep -Fn .test_email
Lib/test/test_email/__init__.py:9:from test.test_email import __file__ as landmark
Lib/test/test_email/__main__.py:1:from test.test_email import load_tests
Lib/test/test_email/test__encoded_words.py:4:from test.test_email import TestEmailBase
Lib/test/test_email/test__header_value_parser.py:6:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_asian_codecs.py:8:from test.test_email.test_email import TestEmailBase
Lib/test/test_email/test_contentmanager.py:2:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_defect_handling.py:6:from test.test_email import TestEmailBase
Lib/test/test_email/test_email.py:42:from test.test_email import openfile, TestEmailBase
Lib/test/test_email/test_generator.py:8:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_headerregistry.py:8:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_inversion.py:11:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_message.py:5:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/test_parser.py:5:from test.test_email import TestEmailBase
Lib/test/test_email/test_pickleable.py:9:from test.test_email import TestEmailBase, parameterize
Lib/test/test_email/torture_test.py:15:from email.test.test_email import TestEmailBase
Misc/HISTORY:1733:- Issue #8315: (partial fix) python -m unittest test.test_email now works.

BTW, I'm not sure these two files are used anywhere, because grep gives no results for their names.
msg264673 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-05-02 21:33
torture_test is not currently run, and this is intentional (it uses a large external resource).  It is kept for reference and in case anyone wants to run it by hand[*].  The import should be fixed.

test_asian_codecs is run automatically by the unittest load tests protocol.  That import should be fixed as well since it is picking up the class from the wrong location.

[*] At one point I was working on making it run when the largefile resource is asserted, by downloading the resource.  But I'm not convinced it is a good idea, so I abandonded that.
msg265032 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-05-06 21:09
As with #26911, no 'test_' prefix means 'run by hand'.  I will make the two simple fixes, as well as delete 'from types import ListType' (ListType is list, and removed in 3.x).  But I will not try to run the torture test, hence no guarantee that it will run after import.
msg265034 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-06 21:35
New changeset e7da216ba17c by Terry Jan Reedy in branch '3.5':
Issue 26912: fix broken imports in test_email package.
https://hg.python.org/cpython/rev/e7da216ba17c
msg265035 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-05-06 21:54
I also removed try to import the deleted support.TestSkipped.  I temporarily commented out the SkipTest replacement so the module would run, create the test class, run it, and fail.

I believe the import of run_unittest and the associated test_main, etc, can be deleted, but that is another issue.
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71099
2016-05-06 21:54:25terry.reedysetstatus: open -> closed
messages: + msg265035

assignee: terry.reedy
resolution: fixed
stage: needs patch -> resolved
2016-05-06 21:35:38python-devsetnosy: + python-dev
messages: + msg265034
2016-05-06 21:09:21terry.reedysetnosy: + terry.reedy
title: test/test_email/torture_test.py (and test_asian_codecs.py) has a broken import -> Broken imports in test/test_email/torture_test.py, test_asian_codecs.py) has a broken import
messages: + msg265032

type: compile error -> behavior
stage: needs patch
2016-05-02 21:33:24r.david.murraysetmessages: + msg264673
2016-05-02 21:23:16zach.waresetnosy: + barry, r.david.murray

components: + email
versions: + Python 3.6
2016-05-02 20:44:13imzcreate