From 9beeef970e17fa5bb717681b1d7e89414d8eb21c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 20 May 2017 04:36:33 -0400 Subject: [PATCH] Parse the filename in the generator expression --- _pytest/config.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index 9fc2ed5fe..420ae5910 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -1013,15 +1013,14 @@ class Config(object): # so it shouldn't be an issue metadata_files = 'RECORD', 'SOURCES.txt' - metadata_entries = ( - entry + package_files = ( + entry.split(',')[0] for entrypoint in pkg_resources.iter_entry_points('pytest11') for metadata in metadata_files for entry in entrypoint.dist._get_metadata(metadata) ) - for entry in metadata_entries: - fn = entry.split(',')[0] + for fn in package_files: is_simple_module = os.sep not in fn and fn.endswith('.py') is_package = fn.count(os.sep) == 1 and fn.endswith('__init__.py') if is_simple_module: