mirror of https://github.com/nucypher/nucypher.git
Use fixed binary value for test
The use of randomly generated values for pytest parameters may cause errors in test explorer in Visual Studio Code. Specifically, `test_return_value_serialization` test returns the following error when a random parameter is used: ``` Test result not found for: ./tests/unit/conditions/test_return_value.py::test_return_value_serialization [\xbd\x01\t\xecV\x05\x04\xe2\x9b(\xb6\xcef\xea\xa4\xfa] ``` Since the rest of values used in this test are fixed, there is no reason to use a random value for bytes parameter.pull/3071/head
parent
c03c0199eb
commit
4d25e97d67
|
@ -41,7 +41,6 @@ def test_return_value_index():
|
|||
_ = ReturnValueTest(comparator=">", value="0", index="james")
|
||||
|
||||
|
||||
|
||||
def test_return_value_index():
|
||||
test = ReturnValueTest(comparator=">", value="0", index=0)
|
||||
assert test.eval([1])
|
||||
|
@ -60,8 +59,6 @@ def test_return_value_index_tuple():
|
|||
assert not test.eval((-1,))
|
||||
|
||||
|
||||
|
||||
|
||||
def test_return_value_test_invalid_comparators():
|
||||
with pytest.raises(ReturnValueTest.InvalidExpression):
|
||||
_ = ReturnValueTest(comparator="eq", value=1)
|
||||
|
@ -216,7 +213,7 @@ def test_return_value_test_bool():
|
|||
"0xaDD9D957170dF6F33982001E4c22eCCdd5539118", # string that is evaluated as int
|
||||
125, # int
|
||||
1.223, # float
|
||||
os.urandom(16), # bytes
|
||||
b"\xe4\xe4u\x18\x03\x81i\xb74\x0e\xf5\xeb\x18\xf0\x0f\x82", # bytes
|
||||
True, # bool
|
||||
"True", # bool as string
|
||||
(1, True, "love"), # tuple
|
||||
|
|
Loading…
Reference in New Issue