mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Fixed segmentation faults from doctests under Python 3.10 (#2994)
* ignore *opengl* glob for module doctests again * removed custom pytest_report_header, fixes testing submodules (????) * restore previous version of conftest, with segfault fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * handle situation of non-available readline * Update conftest.py Co-authored-by: Naveen M K <naveen521kk@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Naveen M K <naveen521kk@gmail.com>
This commit is contained in:
parent
98993ba9ad
commit
f65991c289
2 changed files with 13 additions and 5 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -201,7 +201,7 @@ jobs:
|
|||
|
||||
- name: Run module doctests
|
||||
run: |
|
||||
poetry run python -m pytest -v --cov-append --doctest-modules manim
|
||||
poetry run python -m pytest -v --cov-append --ignore-glob="*opengl*" --doctest-modules manim
|
||||
|
||||
- name: Run doctests in rst files
|
||||
run: |
|
||||
|
|
|
|||
16
conftest.py
16
conftest.py
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
try:
|
||||
# https://github.com/moderngl/moderngl/issues/517
|
||||
import readline # required to prevent a segfault on Python 3.10
|
||||
except ModuleNotFoundError: # windows
|
||||
pass
|
||||
|
||||
import moderngl
|
||||
|
||||
# If it is running Doctest the current directory
|
||||
|
|
@ -30,10 +36,12 @@ def temp_media_dir(tmpdir, monkeypatch, request):
|
|||
|
||||
def pytest_report_header(config):
|
||||
ctx = moderngl.create_standalone_context()
|
||||
info = ctx.info
|
||||
ctx.release()
|
||||
return (
|
||||
"\nOpenGL Information",
|
||||
"\nOpenGL information",
|
||||
"------------------",
|
||||
f"vendor: {ctx.info['GL_VENDOR'].strip()}",
|
||||
f"renderer: {ctx.info['GL_RENDERER'].strip()}",
|
||||
f"version: {ctx.info['GL_VERSION'].strip()}\n",
|
||||
f"vendor: {info['GL_VENDOR'].strip()}",
|
||||
f"renderer: {info['GL_RENDERER'].strip()}",
|
||||
f"version: {info['GL_VERSION'].strip()}\n",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue