Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
pip install -U pip setuptools wheel
pip install -r dev_requirements.txt
python setup.py build_ext --inplace
python -m pytest
python -m pytest --iterations=8 --parallel-threads=auto
- name: build and install the wheel
run: |
python setup.py bdist_wheel
Expand Down
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ black==24.3.0
flake8==4.0.1
isort==5.10.1
pytest>=7.0.0
pytest-run-parallel>=0.7.1
setuptools
vulture>=2.3.0
wheel>=0.30.0
4 changes: 4 additions & 0 deletions tests/test_gc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import gc

import pytest

import libvalkey


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_reader_gc():
class A:
def __init__(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def test_dict(reader):
assert {b"radius": 4.5, b"diameter": 9} == reader.gets()


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_set_with_nested_dict(reader):
reader.feed(b"~2\r\n+tangerine\r\n%1\r\n+a\r\n:1\r\n")
if reader.convertSetsToLists:
Expand All @@ -196,6 +198,8 @@ def test_map_inside_list(reader):
assert [{b"a": 1}] == reader.gets()


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_map_inside_set(reader):
reader.feed(b"~1\r\n%1\r\n+a\r\n:1\r\n")
if reader.convertSetsToLists:
Expand All @@ -206,6 +210,8 @@ def test_map_inside_set(reader):
reader.gets()


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_set_as_map_key(reader):
reader.feed(b"%1\r\n~1\r\n:1\r\n:2\r\n")
with pytest.raises(TypeError):
Expand Down Expand Up @@ -388,6 +394,8 @@ def test_feed_bytearray(reader):
assert b"ok" == reader.gets()


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_maxbuf(reader):
defaultmaxbuf = reader.getmaxbuf()
reader.setmaxbuf(0)
Expand All @@ -400,6 +408,8 @@ def test_maxbuf(reader):
reader.setmaxbuf(-4)


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_len(reader):
assert reader.len() == 0
data = b"+ok\r\n"
Expand All @@ -416,6 +426,8 @@ def test_len(reader):
assert reader.len() == 5


@pytest.mark.iterations(1)
@pytest.mark.thread_unsafe
def test_reader_has_data(reader):
assert reader.has_data() is False
data = b"+ok\r\n"
Expand Down