run -m fails to run on zipped python distributions

Issue #350 closed
theiviaxx created an issue

The use case is Maya, but would apply to any other distribution of python in its zipped form. Maya has mayapy.exe and works great, however all of pythons standard lib is zipped. It looks like imp is unable to find the module if it lives inside a zip file. so running

coverage.exe run -m unittest discover

will yield

No module named unittest

Comments (5)

  1. Loic Dachary

    It works with coverage 4.2

    (v) loic@fold:/tmp/g$ pip install coverage
    Collecting coverage
    Installing collected packages: coverage
    Successfully installed coverage-4.2
    (v) loic@fold:/tmp/g$ coverage run
    (v) loic@fold:/tmp/g$ coverage report -m
    Name                    Stmts   Miss  Cover   Missing
    -----------------------------------------------------                        2      0   100%       0      0   100%         2      0   100%
    TOTAL                       4      0   100%
    (v) loic@fold:/tmp/g$ unzip -t
        testing: zp/                      OK
        testing: zp/           OK
        testing: zp/             OK
    No errors detected in compressed data of
    (v) loic@fold:/tmp/g$ cat
    from zp import sample
  2. theiviaxx reporter

    just tried on 4.3.1 and i get the same error. i'll try to dig around a little more to see if this is in fact something with coverage or just a mayapy thing

  3. Log in to comment