Message288531
| Author |
Andrei Fokau |
| Recipients |
Andrei Fokau, barry |
| Date |
2017年02月24日.20:16:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1487967420.04.0.20803739138.issue29642@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2017年02月24日 20:17:00 | Andrei Fokau | set | recipients:
+ Andrei Fokau, barry |
| 2017年02月24日 20:17:00 | Andrei Fokau | set | messageid: <1487967420.04.0.20803739138.issue29642@psf.upfronthosting.co.za> |
| 2017年02月24日 20:17:00 | Andrei Fokau | link | issue29642 messages |
| 2017年02月24日 20:16:59 | Andrei Fokau | create |
|