I have a problem with the Plone fixture with a package that depends on plone.app.upgrade
The tests fail to even start on Plone5.2/Python2.7 with this error:
Set up plone.app.testing.layers.PloneFixture AttributeError: 'module' object has no attribute '__file__'
I have a problem with the Plone fixture with a package that depends on
plone.app.upgrade
The tests fail to even start on Plone5.2/Python2.7 with this error:Running the tests with
-D
I can see that the problem is that the fixture tries to loadplone.app.folder
's zcml, which is a module alias created byplone.app.upgrade
whennogopip
was moved: https://github.com/plone/plone.app.upgrade/blob/30eb0fbf4e79f496be48ca597fca155648cf7d08/plone/app/upgrade/__init__.py#L161This is an interactive debug section:
Of course regular modules have a file:
The error appears because my addon depends on plone.app.upgrade (and pulls in the alias) and because of this code that adds
plone.app.folder
to the list of modules to import if it is importable: https://github.com/plone/plone.app.testing/blob/690300e9a8a5e174f29aeed4ddd8eb38cf55ae2b/src/plone/app/testing/layers.py#L75-L82