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.

Author vstinner
Recipients paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2018-07-23.12:56:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532350615.01.0.56676864532.issue34200@psf.upfronthosting.co.za>
In-reply-to
Content
The test creates the following files:

/tmp/tmpsobc8gzf/t7.py
/tmp/tmpsobc8gzf/t7
/tmp/tmpsobc8gzf/t7/__init__.py
/tmp/tmpsobc8gzf/t7/sub.py
/tmp/tmpsobc8gzf/t7/sub
/tmp/tmpsobc8gzf/t7/sub/__init__.py
/tmp/tmpsobc8gzf/t7/sub/.py
/tmp/tmpsobc8gzf/t7/sub/subsub
/tmp/tmpsobc8gzf/t7/sub/subsub/__init__.py

/tmp/tmpsobc8gzf contains t7.py file and t7/ subdirectory.


The test pass when the directory is loaded:

vstinner@apu$ ./python -m test test_pkg -m test_7
Run tests sequentially
0:00:00 load avg: 0.96 [1/1] test_pkg
MODULE <module 't7' from '/tmp/tmp4f6zuep7/t7/__init__.py'>

== Tests result: SUCCESS ==

1 test OK.

Total duration: 51 ms
Tests result: SUCCESS


But fail when it gets the t7.py file:

vstinner@apu$ ./python -m test test_pkg -m test_7
Run tests sequentially
0:00:00 load avg: 0.96 [1/1] test_pkg
MODULE <module 't7' from '/tmp/tmpqzs7ftzl/t7.py'>
test test_pkg failed -- Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_pkg.py", line 261, in test_7
    '__name__', '__package__', '__path__', '__spec__'])
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', '__package__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', '__package__', '__path__', '__spec__']

First differing element 6:
'__spec__'
'__path__'

Second list contains 1 additional elements.
First extra element 7:
'__spec__'

  ['__cached__',
   '__doc__',
   '__file__',
   '__loader__',
   '__name__',
   '__package__',
+  '__path__',
   '__spec__']

test_pkg failed

== Tests result: FAILURE ==

1 test failed:
    test_pkg

Total duration: 49 ms
Tests result: FAILURE
History
Date User Action Args
2018-07-23 12:56:55vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, steve.dower
2018-07-23 12:56:55vstinnersetmessageid: <1532350615.01.0.56676864532.issue34200@psf.upfronthosting.co.za>
2018-07-23 12:56:55vstinnerlinkissue34200 messages
2018-07-23 12:56:54vstinnercreate