Andrei Fokau added the comment:

Ok, it's actually not so hard to work around (for Python 3.6, at least):


import os
from unittest import TestLoader

class CustomTestLoader(TestLoader):
    def _find_test_path(self, full_path, pattern, namespace=False):
        original_isfile = os.path.isfile

        def patched_isfile(path):
            return str(path).endswith('__init__.py') or original_isfile(path)

        os.path.isfile = patched_isfile
        result = super()._find_test_path(full_path=full_path, pattern=pattern,
                                         namespace=namespace)
        os.path.isfile = original_isfile
        return result


I'll try to submit a pull request if it can be resolved properly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29642>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to