Open AvnerCohen opened 5 years ago
A docker repro - https://github.com/AvnerCohen/repro-pytest-segafault
I am having this same issue using OpenCV. The seg fault happens on import cv2
after calling pytest. Downgrading to snapshottest 0.5.0 fixes the issue for me.
Here is an example of the bug: https://github.com/sabard/snapshottest-cv2-bug
BTW—this only happens on Python 3.7, not 3.8. Unfortunately, we need to use 3.7 for the version of OpenCV we're using.
From another issue, I think there's a fork of snapshottest which is a bit more up to date. As an alternative, I've been working on my own snapshot library (pytest only) which has addressed all the open issues in this repo. It's also actively developed, if you want to give it a try. We're very much open to community feedback (and contributions): https://github.com/tophat/syrupy.
Migration has been kept simple, no need to change call sites (unless you want to use our more pytest friendly syntax).
I imagine this must be an upstream issue. Based on reading pytest-dev/pytest#3672, it sounds like it is also not an issue with pytest. Python 3.7 is still being supported, so I'd suggest trying to continue the work done in that issue to isolate the problem, and reporting it upstream with Python itself.
Seething this crash, full report in here: https://github.com/pytest-dev/pytest/issues/3672 Once snapshottest is uninstalled (even of not in use, as in the example provided) this does not happen.
Very easy to recreate. Any thoughts? or anything I can provide or test?