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: test_startup_imports fails in test_site when executed inside venv
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, christian.heimes, finitemachine, ncoghlan, vinay.sajip, vstinner
Priority: normal Keywords:

Created on 2014-03-19 20:45 by finitemachine, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg214134 - (view) Author: FiniteMachine (finitemachine) Date: 2014-03-19 20:45
test_startup_imports fails in test_site when executed from within a virtual environment (venv). Test passes when not executed within a venv.

$ python -m test test_site

[1/1] test_site
test test_site failed -- Traceback (most recent call last):
  File "/software/python/lib/python3.4/test/test_site.py", line 451, in test_startup_imports
    self.assertFalse(modules.intersection(re_mods), stderr)
AssertionError: {'sre_parse', '_sre', 'sre_constants', 're', 'sre_compile'} is not false
msg214210 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2014-03-20 12:22
It looks like the venv checking machinery in site.py was changed in 3.4 to import re conditionally if in a venv (in 3.3, it was an unconditional import). This doesn't seem wrong, so ISTM the test needs changing (it already contains exceptions for particular cases, e.g. OS X, because _osx_support uses re - this seems to be an analogous case).
msg364522 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-18 14:58
I close the issue. This bug has no activity for 6 years and was reported on Python 3.4, whereas the development branch is now the future Python 3.9. If you can still reproduce the issue, please reopen the issue or open a new issue (add a reference to this one).
History
Date User Action Args
2022-04-11 14:58:00adminsetgithub: 65185
2020-03-18 14:58:53vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg364522

resolution: out of date
stage: resolved
2014-03-20 13:53:35brett.cannonsetnosy: + brett.cannon
2014-03-20 12:22:07vinay.sajipsetnosy: + christian.heimes
messages: + msg214210
2014-03-19 23:56:41pitrousetnosy: + vinay.sajip, ncoghlan
2014-03-19 20:46:13finitemachinesettitle: test_startup_imports fails in test_site while executed inside venv -> test_startup_imports fails in test_site when executed inside venv
2014-03-19 20:45:53finitemachinecreate