Skip to content
Merged
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ pyrightconfig.json
# Devenv stuff
.devenv.flake.nix
devenv.*

dump.rdb
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "bytewax_redis"
name = "bytewax-redis"
version = "0.1"
description = "A Bytewax connector for Redis"
readme = "README.md"
Expand Down Expand Up @@ -37,7 +37,10 @@ requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "-v"
addopts = "-v -m \"not integration\""
markers = [
"integration: requires a local redis server",
]

[tool.mypy]
disallow_untyped_defs = true
Expand Down
20 changes: 7 additions & 13 deletions pytests/test_bytewax_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
from bytewax.testing import TestingSink, TestingSource, run_main


@mark.skipif(
os.environ.get("REDIS_HOST") is None
or os.environ.get("REDIS_PORT") is None
or os.environ.get("REDIS_DB") is None
or os.environ.get("REDIS_STREAM") is None,
reason="A running Redis instance has to be configured for this test",
)
@mark.integration
def test_redis_stream_roundtrip() -> None:
# Get redis config values.
redis_host = os.environ.get("REDIS_HOST", "localhost")
Expand Down Expand Up @@ -78,12 +72,7 @@ def run_flow(out: list) -> None:
assert out == expected


@mark.skipif(
os.environ.get("REDIS_HOST") is None
or os.environ.get("REDIS_PORT") is None
or os.environ.get("REDIS_DB") is None,
reason="A running Redis instance has to be configured for this test",
)
@mark.integration
def test_kv_sink() -> None:
# Get redis config values.
redis_host = os.environ.get("REDIS_HOST", "localhost")
Expand Down Expand Up @@ -112,3 +101,8 @@ def test_kv_sink() -> None:
# Now check that the data is there
assert redis_conn.get("key-1") == b"3"
assert redis_conn.get("key-2") == b"5"


# Test here to avoid exit code 5 from Pytest runs
def test_placeholder() -> None:
pass