Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_import failures #56332

Closed
pitrou opened this issue May 19, 2011 · 3 comments
Closed

test_import failures #56332

pitrou opened this issue May 19, 2011 · 3 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented May 19, 2011

BPO 12123
Nosy @warsaw, @brettcannon, @ncoghlan, @pitrou, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2011-05-20.00:12:09.307>
created_at = <Date 2011-05-19.16:26:48.066>
labels = ['type-bug', 'tests']
title = 'test_import failures'
updated_at = <Date 2011-05-20.00:12:09.305>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2011-05-20.00:12:09.305>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2011-05-20.00:12:09.307>
closer = 'vstinner'
components = ['Tests']
creation = <Date 2011-05-19.16:26:48.066>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 12123
keywords = []
message_count = 3.0
messages = ['136305', '136320', '136345']
nosy_count = 5.0
nosy_names = ['barry', 'brett.cannon', 'ncoghlan', 'pitrou', 'vstinner']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue12123'
versions = ['Python 3.3']

@pitrou
Copy link
Member Author

pitrou commented May 19, 2011

I get the following failures under a fresh checkout:

======================================================================
ERROR: test_file_to_source (test.test_import.ImportTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 253, in test_file_to_source
    make_legacy_pyc(source)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test___cached___legacy_pyc (test.test_import.PycacheTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 584, in test___cached___legacy_pyc
    pyc_file = make_legacy_pyc(self.source)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_missing_source_legacy (test.test_import.PycacheTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 564, in test_missing_source_legacy
    pyc_file = make_legacy_pyc(self.source)
  File "/home/antoine/t/cpython/Lib/test/support.py", line 217, in make_legacy_pyc
    os.rename(pyc_file, legacy_pyc)
OSError: [Errno 2] No such file or directory

======================================================================
FAIL: test_execute_bit_not_copied (test.test_import.ImportTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 112, in test_execute_bit_not_copied
    self.fail("__import__ did not result in creation of "
AssertionError: __import__ did not result in creation of either a .pyc or .pyo file

======================================================================
FAIL: test_import_pyc_path (test.test_import.PycacheTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 531, in test_import_pyc_path
    self.assertTrue(os.path.exists('__pycache__'))
AssertionError: False is not true

======================================================================
FAIL: test_missing_source (test.test_import.PycacheTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 552, in test_missing_source
    self.assertTrue(os.path.exists(pyc_file))
AssertionError: False is not true

======================================================================
FAIL: test_unwritable_directory (test.test_import.PycacheTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/antoine/t/cpython/Lib/test/test_import.py", line 543, in test_unwritable_directory
    self.assertTrue(os.path.exists('__pycache__'))
AssertionError: False is not true

@pitrou pitrou added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels May 19, 2011
@pitrou
Copy link
Member Author

pitrou commented May 19, 2011

This is due to PYTHONDONTWRITEBYTECODE being set. Not sure this is worth fixing.

@vstinner
Copy link
Member

Duplicate of bpo-12117.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants