Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Segmentation Fault when tqdm is used in pytest parametrize #1678

@eamanu

Description

@eamanu

HI,

A Segmentation fault happen when tqdm is used in pytest.mark.parametrize

To reproduce the issue you can run this test:

import pytest
from tqdm import tqdm

@pytest.mark.parametrize("progress", (None, tqdm(desc="hola")))
def test_poc(progress):
    if progress is not None:
        progress.total = 100
        progress.n = 20
        progress.refresh()
    assert 1==1

This is the output of pytest:

=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.13.5, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/eamanu/Debian/tqdm/test
plugins: typeguard-4.4.2, anyio-4.8.0
collected 2 items                                                                                                                                                                                                 

test.py ..                                                                                                                                                                                                  [100%]

================================================================================================ 2 passed in 0.04s ================================================================================================
[1]    210179 segmentation fault  pytest test.py

The bugs was originally reported here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101839

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions