<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 9/18/13 3:42 AM, Lucian Ciufudean wrote:<br>
    <blockquote
cite="mid:CANn=0kzkje=eWDNk115MNN2fxJX2RTYqYsiZ25_EDALhL4YOPQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Here is how I ran coverage:
        <div><br>
        </div>
        <div>&nbsp; &nbsp; coverage run --source=../src main.py<br>
        </div>
        <div><br>
        </div>
        <div>main.py imports a pyc file that resides in the same folder.
          The source of this pyc file is available in ../src.</div>
        <div>(I created main.py just to go around the bug that you
          submitted above)</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    You don't mention the exact errors you saw (details matter), but in
    your previous message you mentioned the problem being while
    reporting.&nbsp; You'll also have to specify the source directory during
    the "coverage html" command (or coverage.html() call).&nbsp; A good way
    to do this is with a .coveragerc file.<br>
    <br>
    --Ned.<br>
    <br>
    <blockquote
cite="mid:CANn=0kzkje=eWDNk115MNN2fxJX2RTYqYsiZ25_EDALhL4YOPQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Lucian</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Sep 18, 2013 at 5:05 AM, Ned
          Batchelder <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:ned@nedbatchelder.com" target="_blank">ned@nedbatchelder.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div class="im"> On 9/17/13 7:42 AM, Lucian Ciufudean
                wrote:<br>
                <blockquote type="cite">
                  <div dir="ltr">Hi guys,
                    <div><br>
                    </div>
                    <div>I embarked on the road of obtaining a coverage
                      report for functional tests against a server
                      process. The server is deployed as .pyc files, and
                      the source files can be made available in a
                      separate subversion working folder. I wouldn't
                      want to edit any existing .py files.</div>
                    <div><br>
                    </div>
                    <div>Can coverage work with .pyc files - I am
                      getting errors when using coverage run main.pyc
                      from the command line, so maybe with the API? <br>
                    </div>
                  </div>
                </blockquote>
                <br>
              </div>
              Hmm, you're right: "coverage run foo.pyc" does not work.
              I've created a ticket for this:
              <a moz-do-not-send="true"
href="https://bitbucket.org/ned/coveragepy/issue/264/coverage-wont-run-pyc-files"
                target="_blank">https://bitbucket.org/ned/coveragepy/issue/264/coverage-wont-run-pyc-files</a>
              <div class="im"><br>
                <br>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>I tired this also, my custom code is run but it
                      can not find the source files at the time of
                      coverage.html_report() although I passed the
                      directory of source files to coverage.coverage.</div>
                  </div>
                </blockquote>
                <br>
              </div>
              You'll have to show details of how you tried to run
              coverage.&nbsp; If the .py files are in the places reported by
              your program, then it should work.&nbsp; You can also use the
              [paths] section of a .coveragerc to instruct coverage
              where the files are.<br>
              <br>
              --Ned.<br>
              <br>
              <blockquote type="cite">
                <div dir="ltr">
                  <div><br>
                  </div>
                  <div>Thanks a lot,</div>
                  <div>Lucian</div>
                </div>
                <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
testing-in-python mailing list
<a moz-do-not-send="true" href="mailto:testing-in-python@lists.idyll.org" target="_blank">testing-in-python@lists.idyll.org</a>
<a moz-do-not-send="true" href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a>
</pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>