Content-Length: 330461 | pFad | http://github.com/mindflayer/python-mocket/commit/895e299f174710bf1ea054ace4421e1dbd0aa3c1

AF Target `make safetest` got broken (#273) · mindflayer/python-mocket@895e299 · GitHub
Skip to content

Commit 895e299

Browse files
authored
Target make safetest got broken (#273)
* Fix `Makefile`. * Only running tests that don't use real sockets got broken, fixed by adding CIENT SETINFO commands
1 parent 9cfad4c commit 895e299

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ types:
3131
test: types
3232
@echo "Running Python tests"
3333
uv pip uninstall pook || true
34-
export VIRTUAL_ENV=.venv; .venv/bin/wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- .venv/bin/pytest
34+
.venv/bin/wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- .venv/bin/pytest
3535
uv pip install pook && .venv/bin/pytest tests/test_pook.py && uv pip uninstall pook
3636
@echo ""
3737

3838
safetest:
39-
export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; make test
39+
export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; .venv/bin/pytest
4040

4141
publish: clean install-test-requirements
4242
uv run python3 -m build --sdist --wheel .

tests/test_mocket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def test_patch(
222222

223223

224224
@pytest.mark.skipif(not psutil.POSIX, reason="Uses a POSIX-only API to test")
225+
@pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)')
225226
@pytest.mark.asyncio
226227
async def test_no_dangling_fds():
227228
url = "http://httpbin.local/ip"

tests/test_redis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ def setUp(self):
158158
self.rclient = redis.StrictRedis()
159159

160160
def mocketize_setup(self):
161+
Entry.register_response("CLIENT SETINFO LIB-NAME redis-py", OK)
162+
Entry.register_response(f"CLIENT SETINFO LIB-VER {redis.__version__}", OK)
161163
Entry.register_response("FLUSHDB", OK)
162164
self.rclient.flushdb()
163-
self.assertEqual(len(Mocket.request_list()), 1)
165+
self.assertEqual(len(Mocket.request_list()), 3)
164166
Mocket.reset()
165167

166168
@mocketize

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mindflayer/python-mocket/commit/895e299f174710bf1ea054ace4421e1dbd0aa3c1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy