From 94b248fd8937468419ee6e90e6fc42f26695f009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 26 May 2019 15:24:28 +0200 Subject: [PATCH] Avoid randomly parametrized test cases to avoid confusing pytest --- tests.py => test_echo_server.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename tests.py => test_echo_server.py (95%) diff --git a/tests.py b/test_echo_server.py similarity index 95% rename from tests.py rename to test_echo_server.py index 04014c7..d0437cb 100644 --- a/tests.py +++ b/test_echo_server.py @@ -92,10 +92,6 @@ def test_stop(): 'You ever wonder why we are here?', 'Lorem ipsum dolor sit amet', 'You always have a plan, Dutch!', - token_urlsafe(32), - token_urlsafe(32), - token_urlsafe(32), - token_urlsafe(32) ] ) def test_io(io_pipes, test_data): @@ -103,6 +99,12 @@ def test_io(io_pipes, test_data): assert io_pipes.recv().decode() == test_data +def test_io_random(io_pipes): + test_data = token_urlsafe(512) + for _ in range(100): + io_pipes.send_message(test_data.encode()) + assert io_pipes.recv().decode() == test_data + @pytest.mark.parametrize( 'test_data_size', [ 1024,