Skip to content

Commit

Permalink
Write real test for AttributeError for module.__file__.
Browse files Browse the repository at this point in the history
Issue #6.
  • Loading branch information
mauritsvanrees committed Feb 27, 2019
1 parent 8fc9aa2 commit 7fdf681
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/z3c/autoinclude/dependency.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ This is easiest to test by some hacking.
>>> DistributionManager.orig_dottedNames = DistributionManager.dottedNames
>>> def dottedNames(self):
... result = self.orig_dottedNames()
... result.extend(['z3c.autoinclude.tests.empty', 'nosuchpackage'])
... result.extend(['z3c.autoinclude.tests.nomodulefile', 'nosuchpackage'])
... return result
>>> DistributionManager.dottedNames = dottedNames
>>> pprint(b_include_finder.includableInfo(['configure.zcml',
Expand Down
3 changes: 0 additions & 3 deletions src/z3c/autoinclude/tests/empty/.gitkeep

This file was deleted.

6 changes: 6 additions & 0 deletions src/z3c/autoinclude/tests/nomodulefile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This directory is used in a test in dependency.txt.
# We need a package with a module that has no __file__ attribute.
# This can happen in corner cases, for example with 'backports' on Python 2.7.
# See https://github.com/zopefoundation/z3c.autoinclude/issues/6.
del __file__

0 comments on commit 7fdf681

Please sign in to comment.