6d8625611ff936bab56d15a2b36e0aba7e54612e,src/python/pants/backend/python/tasks2/pytest_run.py,PytestRun,_do_run_tests,#PytestRun#Any#Any#,453

Before Change


      // The user might have already specified the resultlog option. In such case, reuse it.
      resultlog_arg = _extract_resultlog_filename(args)

      if resultlog_arg:
        return run_and_analyze(resultlog_arg)
      else:
        with temporary_file_path() as resultlog_path:
          args.insert(0, "--resultlog={0}".format(resultlog_path))
          return run_and_analyze(resultlog_path)

  def _pex_run(self, pex, workunit, args, env):
    process = self._spawn(pex, workunit, args, setsid=False, env=env)
    return process.wait()

After Change


      // Validate that the user didn"t provide any passthru args that conflict
      // with those we must set ourselves.
      for arg in self.get_passthru_args():
        if arg.startswith("--junitxml") or arg.startswith("--confcutdir"):
          raise TaskError("Cannot pass this arg through to pytest: {}".format(arg))

      junitxml_path = self._get_junit_xml_path(targets)
      // N.B. the `--confcutdir` here instructs pytest to stop scanning for conftest.py files at the
      // top of the buildroot. This prevents conftest.py files from outside (e.g. in users home dirs)
      // from leaking into pants test runs. See: https://github.com/pantsbuild/pants/issues/2726
      args = ["--junitxml", junitxml_path, "--confcutdir", get_buildroot()]
      if self.get_options().fail_fast:
        args.extend(["-x"])
      if self._debug:
        args.extend(["-s"])
      if self.get_options().colors:
        args.extend(["--color", "yes"])
      for options in self.get_options().options + self.get_passthru_args():
        args.extend(safe_shlex_split(options))
      args.extend(test_args)
      args.extend(sources)

      result = self._do_run_tests_with_args(pex, workunit, args)
      external_junit_xml_dir = self.get_options().junit_xml_dir
      if external_junit_xml_dir:
        safe_mkdir(external_junit_xml_dir)
        shutil.copy(junitxml_path, external_junit_xml_dir)
      failed_targets = self._get_failed_targets_from_junitxml(junitxml_path, targets)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pantsbuild/pants
Commit Name: 6d8625611ff936bab56d15a2b36e0aba7e54612e
Time: 2017-03-30
Author: benjyw@gmail.com
File Name: src/python/pants/backend/python/tasks2/pytest_run.py
Class Name: PytestRun
Method Name: _do_run_tests


Project Name: CellProfiler/CellProfiler
Commit Name: 64f63c69bb6d88a75326b6291903211cb9c2a651
Time: 2010-12-17
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/gui/html/htmlwindow.py
Class Name: HtmlClickableWindow
Method Name: OnOpeningURL


Project Name: tensorflow/datasets
Commit Name: 161014d590fcf3d8af24628c1199be370ef9c88f
Time: 2019-03-14
Author: rickdey1998@gmail.com
File Name: tensorflow_datasets/core/download/downloader.py
Class Name: _Downloader
Method Name: _sync_download