Commits

Anonymous committed a2ddd54

Change to use source option in coverage 3.4

Comments (0)

Files changed (3)

             for node_desc in sorted(self.node_descs):
                 self.sep(stream, ' ', '%s' % node_desc)
 
-        # Determine the files to limit reports on.
-        morfs = list(set(filename
-                         for filename in self.cov.data.executed_files()
-                         for source in self.cov_source
-                         if os.path.realpath(filename).startswith(os.path.realpath(source))))
+        # Produce terminal report if wanted.
+        if 'term' in self.cov_report or 'term-missing' in self.cov_report:
+            show_missing = 'term-missing' in self.cov_report
+            self.cov.report(show_missing=show_missing, ignore_errors=True, file=stream)
 
-        if morfs:
-            # Produce terminal report if wanted.
-            if 'term' in self.cov_report or 'term-missing' in self.cov_report:
-                show_missing = 'term-missing' in self.cov_report
-                #self.cov.report(show_missing=show_missing, ignore_errors=True, file=stream)
-                self.cov.report(morfs, show_missing=show_missing, ignore_errors=True, file=stream)
+        # Produce annotated source code report if wanted.
+        if 'annotate' in self.cov_report:
+            self.cov.annotate(ignore_errors=True)
+            stream.write('Coverage annotated source written next to source\n')
 
-            # Produce annotated source code report if wanted.
-            if 'annotate' in self.cov_report:
-                #self.cov.annotate(ignore_errors=True)
-                self.cov.annotate(morfs, ignore_errors=True)
-                stream.write('Coverage annotated source written next to source\n')
+        # Produce html report if wanted.
+        if 'html' in self.cov_report:
+            self.cov.html_report(ignore_errors=True)
+            stream.write('Coverage HTML written to dir %s\n' % self.cov.config.html_dir)
 
-            # Produce html report if wanted.
-            if 'html' in self.cov_report:
-                #self.cov.html_report(ignore_errors=True)
-                self.cov.html_report(morfs, ignore_errors=True)
-                stream.write('Coverage HTML written to dir %s\n' % self.cov.config.html_dir)
-
-        else:
-            # Output warning that there is nothing to report on.
-            stream.write('Nothing to report on with specified cov options: %s\n' % ', '.join(self.cov_source))
-
-        # Produce xml report if wanted.  Produce empty reports in case CI server is expecting one.
+        # Produce xml report if wanted.
         if 'xml' in self.cov_report:
-            xml_morfs = morfs or ['BOGUS_TO_PRODUCE_EMPTY_REPORT']
-            #self.cov.xml_report(ignore_errors=True)
-            self.cov.xml_report(xml_morfs, ignore_errors=True)
-            if morfs:
-                stream.write('Coverage XML written to file %s\n' % self.cov.config.xml_output)
-            else:
-                stream.write('Coverage XML written to file %s: empty coverage report\n' % self.cov.config.xml_output)
+            self.cov.xml_report(ignore_errors=True)
+            stream.write('Coverage XML written to file %s\n' % self.cov.config.xml_output)
 
         # Report on any failed slaves.
         if self.failed_slaves:
     def start(self):
         """Erase any previous coverage data and start coverage."""
 
-        self.cov = coverage.coverage(#source=self.cov_source,
+        self.cov = coverage.coverage(source=self.cov_source,
                                      data_file=self.cov_data_file,
                                      config_file=self.cov_config)
         self.cov.erase()
         # If slave is not collocated then we must save the data file
         # that it returns to us.
         if 'cov_slave_lines' in node.slaveoutput:
-            cov = coverage.coverage(#source=self.cov_source,
+            cov = coverage.coverage(source=self.cov_source,
                                     data_file=self.cov_data_file,
                                     data_suffix=node.slaveoutput['cov_slave_node_id'],
                                     config_file=self.cov_config)
         """Combines coverage data and sets the list of coverage objects to report on."""
 
         # Combine all the suffix files into the data file.
-        self.cov = coverage.coverage(#source=self.cov_source,
+        self.cov = coverage.coverage(source=self.cov_source,
                                      data_file=self.cov_data_file,
                                      config_file=self.cov_config)
         self.cov.erase()
         self.cov_data_file += '.%s' % self.nodeid
 
         # Erase any previous data and start coverage.
-        self.cov = coverage.coverage(#source=self.cov_source,
+        self.cov = coverage.coverage(source=self.cov_source,
                                      data_file=self.cov_data_file,
                                      config_file=self.cov_config)
         self.cov.erase()
                                             random.randint(0, 999999))
 
                 # Activate coverage for this process.
-                cov = coverage.coverage(#source=cov_source,
+                cov = coverage.coverage(source=cov_source,
                                         data_file=cov_data_file,
                                         data_suffix=data_suffix,
                                         config_file=cov_config,
 ''' % (PTH_FILE_NAME, PTH_FILE)
 
 setuptools.setup(name='cov-core',
-                 version='1.1',
+                 version='1.2',
                  description='plugin core for use by pytest-cov, nose-cov and unittest2-cov',
                  long_description=open('README.txt').read().strip(),
                  author='Meme Dough',
                  url='http://bitbucket.org/memedough/cov-core/overview',
                  py_modules=['cov_core',
                              'cov_core_init'],
-                 install_requires=['coverage>=3.3.1'],
+                 install_requires=['coverage>=3.4'],
                  license='MIT License',
                  zip_safe=False,
                  keywords='cover coverage',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.