diff --git a/src/pytezos/rpc/shell.py b/src/pytezos/rpc/shell.py index e604ec725..4cc5b7f09 100644 --- a/src/pytezos/rpc/shell.py +++ b/src/pytezos/rpc/shell.py @@ -1,5 +1,5 @@ from binascii import hexlify -from datetime import datetime +from datetime import UTC, datetime from functools import cached_property from functools import lru_cache from time import sleep @@ -109,7 +109,7 @@ def wait_blocks( while current_header['level'] < max_level: logger.info('Current level: %d (max %d)', current_header['level'], max_level) prev_block_dt = datetime.strptime(current_header['timestamp'], '%Y-%m-%dT%H:%M:%SZ') - elapsed_sec = (datetime.utcnow() - prev_block_dt).seconds + elapsed_sec = (datetime.now(UTC) - prev_block_dt).seconds sleep_sec = 1 if elapsed_sec > time_between_blocks else (time_between_blocks - elapsed_sec + 1) logger.info('Sleep %d seconds until block %s is superseded', sleep_sec, current_block_hash) diff --git a/tests/sandbox_tests/test_counter.py b/tests/sandbox_tests/test_counter.py index 452d05c98..7c2b5a602 100644 --- a/tests/sandbox_tests/test_counter.py +++ b/tests/sandbox_tests/test_counter.py @@ -1,6 +1,5 @@ import logging - -from pytest import skip +from unittest import skip from pytezos.rpc.errors import RpcError from pytezos.sandbox.node import SandboxedNodeTestCase diff --git a/tests/unit_tests/test_michelson/test_repl/test_tzt.py b/tests/unit_tests/test_michelson/test_repl/test_tzt.py index 68982adc3..5562f54cd 100644 --- a/tests/unit_tests/test_michelson/test_repl/test_tzt.py +++ b/tests/unit_tests/test_michelson/test_repl/test_tzt.py @@ -15,12 +15,29 @@ class TztTest(TestCase): exclude = [ ".git", "LICENSE", + "coverage.md", + "README.md", + "macro_pack", + # + "add_00.tc.tzt", + "add_01.tc.tzt", # NOTE: unknown primitive `MutezOverflow` "add_mutez-mutez_01.tzt", # NOTE: unknown primitive `Contract` + "address_00.tc.tzt", "address_00.tzt", - "address_01.tzt", "address_02.tzt", + "and_bytes-bytes_00.tzt", + "and_bytes-bytes_01.tzt", + "and_bytes-bytes_02.tzt", + "and_bytes-bytes_03.tzt", + "car_00.tc.tzt", + "cdr_00.tc.tzt", + "checksignature_00.tc.tzt", + "compare_00.tc.tzt", + "compare_01.tc.tzt", + "compare_02.tc.tzt", + "cons_lists_00.tc.tzt", "contract_00.tzt", "contract_01.tzt", "contract_02.tzt", @@ -30,27 +47,82 @@ class TztTest(TestCase): # NOTE: failed to parse expression LexToken(_,'_',1,658) "createcontract_00.tzt", "createcontract_01.tzt", + "dip_00.tc.tzt", + "dipn_00.tc.tzt", + "dipn_01.tc.tzt", + "dipn_02.tc.tzt", + "drop_00.tc.tzt", + "dropn_00.tc.tzt", + "dup_00.tc.tzt", + "dupn_00.tc.tzt", + "dupn_01.tc.tzt", # NOTE: unknown primitive `Failed` + "failwith_00.tc.tzt", "failwith_00.tzt", + "get_00.tc.tzt", + "get_map_00.tc.tzt", + "gt_00.tc.tzt", + "if_00.tc.tzt", + "if_01.tc.tzt", + "ifcons_00.tc.tzt", + "ifleft_00.tc.tzt", + "ifnone_00.tc.tzt", + "int_00.tc.tzt", + "iter_00.tc.tzt", + "loop_00.tc.tzt", + "loop_01.tc.tzt", # NOTE: unknown primitive `GeneralOverflow` "lsl_01.tzt", # NOTE: unknown primitive `GeneralOverflow` "lsr_01.tzt", + "macro_pack", # NOTE: unknown primitive `MutezOverflow` "mul_mutez-nat_01.tzt", - # NOTE: unknown primitive `MutezOverflow + # NOTE: unknown primitive `MutezOverflow` "mul_nat-mutez_01.tzt", + "not_bytes_00.tzt", + "not_bytes_01.tzt", + "not_bytes_02.tzt", + "or_bytes-bytes_00.tzt", + "or_bytes-bytes_01.tzt", + "or_bytes-bytes_02.tzt", + "or_bytes-bytes_03.tzt", + "pack_key_03.tzt", + "pack_lambda_comb_pairs.tzt", + "pack_operation_00.tc.tzt", + "pack_signature_03.tzt", + "pair_00.tc.tzt", + "push_00.tc.tzt", # NOTE: parameter type is not defined "self_00.tzt", + "self_in_lambda.tc.tzt", # NOTE: failed to parse expression LexToken(_,'_',1,199) + "setdelegate_00.tc.tzt", "setdelegate_00.tzt", # NOTE: ('SLICE', 'string is empty') "slice_string_05.tzt", + "some_00.tc.tzt", # NOTE: unknown primitive `MutezUnderflow` "sub_mutez-mutez_01.tzt", + "swap_00.tc.tzt", + "swap_01.tc.tzt", # NOTE: failed to parse expression LexToken(_,'_',1,238) + "transfertokens_00.tc.tzt", "transfertokens_00.tzt", "transfertokens_01.tzt", + "unpair_00.tc.tzt", + "update_00.tc.tzt", + "update_bigmapstringstring_01.tzt", + "update_bigmapstringstring_02.tzt", + "update_bigmapstringstring_03.tzt", + "update_bigmapstringstring_04.tzt", + "update_bigmapstringstring_05.tzt", + "update_bigmapstringstring_06.tzt", + "update_bigmapstringstring_07.tzt", + "xor_bytes-bytes_00.tzt", + "xor_bytes-bytes_01.tzt", + "xor_bytes-bytes_02.tzt", + "xor_bytes-bytes_03.tzt", ] def test_tzt(self) -> None: diff --git a/tests/unit_tests/test_michelson/test_repl/tzt b/tests/unit_tests/test_michelson/test_repl/tzt index d9b32d17a..177079615 160000 --- a/tests/unit_tests/test_michelson/test_repl/tzt +++ b/tests/unit_tests/test_michelson/test_repl/tzt @@ -1 +1 @@ -Subproject commit d9b32d17ab291a12c801b7cc0292a9281cc8e9af +Subproject commit 177079615b07de21dea16d5bb971225ecd322445