Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do coverage reports always crash? #293

Closed
voldemortX opened this issue May 14, 2019 · 5 comments
Closed

Why do coverage reports always crash? #293

voldemortX opened this issue May 14, 2019 · 5 comments

Comments

@voldemortX
Copy link

voldemortX commented May 14, 2019

When I use:
pytest
It's absolutely fine.
However, if I add '--cov=whatever', Python just crashes.
I'm using stackless-python 3.6.6 on Windows 10.
Actually, even the old 'coverage' package doesn't work as well, so I'm not even sure that I should be asking about this here...
Anyways, I'll just submit an issue and hope for some luck.
I have 2 files in the same folder(main.py & test_main.py).
main.py:

def road(x, y):
    return 1

test_main.py:

from main import road


class TestModels(object):
    def setup_class(self):
        # Init
        print('hi')

    def teardown_class(self):
        print('haha')

    def test_exist(self):
        assert road(0, 0) == 1
@ionelmc
Copy link
Member

ionelmc commented May 14, 2019

What exactly does crashing mean? Please add details like traceback, command line, project layout, configuration etc. Ideally you'd post a small reproducing example.

@voldemortX
Copy link
Author

It‘s like standard crashed crash? There is no traceback or anything(Can't add a picture here and the thing is actually in Chinese...)
If I "run pytest with coverage" in Pycharm it reports "Process finished with exit code -1073741819 (0xC0000005)", it's probably the same exit code for pytest-cov.
However in the case of pytest-cov, when I run "pytest" in command line it gives a coverage percentage of the test file itself automatically(But it does not report a percentage for the files that are being tested, which is what I actually need).
And I have been using this conda env for a very long time, it should be quite stable.

@voldemortX
Copy link
Author

The project I'm working on is built by flask, but it behaves exactly the same as that 2-file layout above.

@ionelmc
Copy link
Member

ionelmc commented May 14, 2019

So it's something that only happens when you run pytest from pycharm?

I simply can't tell what the problem is from what you posted so far. You need to try to isolate the cause. Remove options, tools, packages and/or code till it stops reproducing.

@voldemortX
Copy link
Author

Sorry for the troubles...
It turns out to be some sort of compatibility issue with package PyTorch
A default python 3.6.8 enviroment works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants