summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-12-18 16:42:48 -0800
committerMarcus Müller <marcus@hostalia.de>2018-12-19 17:49:09 +0100
commit092aff8628741b38b1e4000370d219b82555169d (patch)
tree1d7cca45216df27cc4224d3b83cacb52021c3ae1 /gr-blocks/python
parentb1e2fdc6e95cf3d8eb76c9f78b976cd1b30d572c (diff)
qa: Use random.seed(0) everywhere import random is used
This affects all Python-based unit tests which use the Python random module. If they do, this change adds random.seed(0) to every setUp() call, so that all QA runs are reproducible.
Diffstat (limited to 'gr-blocks/python')
-rw-r--r--gr-blocks/python/blocks/qa_keep_m_in_n.py2
-rw-r--r--gr-blocks/python/blocks/qa_pack_k_bits.py1
-rw-r--r--gr-blocks/python/blocks/qa_packed_to_unpacked.py1
-rw-r--r--gr-blocks/python/blocks/qa_repack_bits_bb.py1
-rw-r--r--gr-blocks/python/blocks/qa_socket_pdu.py1
-rw-r--r--gr-blocks/python/blocks/qa_unpack_k_bits.py1
6 files changed, 6 insertions, 1 deletions
diff --git a/gr-blocks/python/blocks/qa_keep_m_in_n.py b/gr-blocks/python/blocks/qa_keep_m_in_n.py
index 14d7863bbd..7ef9ae791d 100644
--- a/gr-blocks/python/blocks/qa_keep_m_in_n.py
+++ b/gr-blocks/python/blocks/qa_keep_m_in_n.py
@@ -29,7 +29,7 @@ import random
class test_keep_m_in_n(gr_unittest.TestCase):
def setUp(self):
- pass
+ random.seed(0)
def tearDown(self):
pass
diff --git a/gr-blocks/python/blocks/qa_pack_k_bits.py b/gr-blocks/python/blocks/qa_pack_k_bits.py
index 28285845b3..c82c025306 100644
--- a/gr-blocks/python/blocks/qa_pack_k_bits.py
+++ b/gr-blocks/python/blocks/qa_pack_k_bits.py
@@ -28,6 +28,7 @@ from gnuradio import gr, gr_unittest, blocks
class test_pack(gr_unittest.TestCase):
def setUp(self):
+ random.seed(0)
self.tb = gr.top_block()
def tearDown(self):
diff --git a/gr-blocks/python/blocks/qa_packed_to_unpacked.py b/gr-blocks/python/blocks/qa_packed_to_unpacked.py
index 13e93a7136..ea68b8263c 100644
--- a/gr-blocks/python/blocks/qa_packed_to_unpacked.py
+++ b/gr-blocks/python/blocks/qa_packed_to_unpacked.py
@@ -28,6 +28,7 @@ import random
class test_packing(gr_unittest.TestCase):
def setUp(self):
+ random.seed(0)
self.tb = gr.top_block ()
def tearDown(self):
diff --git a/gr-blocks/python/blocks/qa_repack_bits_bb.py b/gr-blocks/python/blocks/qa_repack_bits_bb.py
index fa86c0ccac..419630b0c5 100644
--- a/gr-blocks/python/blocks/qa_repack_bits_bb.py
+++ b/gr-blocks/python/blocks/qa_repack_bits_bb.py
@@ -28,6 +28,7 @@ import pmt
class qa_repack_bits_bb (gr_unittest.TestCase):
def setUp (self):
+ random.seed(0)
self.tb = gr.top_block ()
self.tsb_key = "length"
diff --git a/gr-blocks/python/blocks/qa_socket_pdu.py b/gr-blocks/python/blocks/qa_socket_pdu.py
index 961dc914ea..21f8ead6ec 100644
--- a/gr-blocks/python/blocks/qa_socket_pdu.py
+++ b/gr-blocks/python/blocks/qa_socket_pdu.py
@@ -29,6 +29,7 @@ import time
class qa_socket_pdu (gr_unittest.TestCase):
def setUp (self):
+ random.seed(0)
self.tb = gr.top_block ()
def tearDown (self):
diff --git a/gr-blocks/python/blocks/qa_unpack_k_bits.py b/gr-blocks/python/blocks/qa_unpack_k_bits.py
index f351e75d30..3e2a107b30 100644
--- a/gr-blocks/python/blocks/qa_unpack_k_bits.py
+++ b/gr-blocks/python/blocks/qa_unpack_k_bits.py
@@ -28,6 +28,7 @@ import random
class test_unpack(gr_unittest.TestCase):
def setUp(self):
+ random.seed(0)
self.tb = gr.top_block ()
def tearDown(self):