From 7f618f8075f0ac7eaeb3f07542daaa1379fedc5d Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 13:59:50 +0000 Subject: [PATCH 01/27] Run examples with warnings --- examples/run_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index aa8049e9..5f45e8cd 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -4,7 +4,7 @@ pushd "$(dirname "$0")" for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" - python $f || exit 1 + python -bb -We -X dev $f || exit 1 echo;echo;echo done From 411e0ac13fec693c7c120664d06adc15f5c0aea6 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 14:05:28 +0000 Subject: [PATCH 02/27] Update serializer_class.py --- examples/serializer_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/serializer_class.py b/examples/serializer_class.py index 50562b12..c155618e 100644 --- a/examples/serializer_class.py +++ b/examples/serializer_class.py @@ -15,7 +15,7 @@ class CompressionSerializer(BaseSerializer): def dumps(self, value): print("I've received:\n{}".format(value)) compressed = zlib.compress(value.encode()) - print("But I'm storing:\n{}".format(compressed)) + print("But I'm storing:\n{}".format(compressed.decode("utf-8"))) return compressed def loads(self, value): From 71bf6d420a44be625c245ca4e56757b439f4c7e7 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 14:14:36 +0000 Subject: [PATCH 03/27] Update serializer_class.py --- examples/serializer_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/serializer_class.py b/examples/serializer_class.py index c155618e..b141c2d8 100644 --- a/examples/serializer_class.py +++ b/examples/serializer_class.py @@ -15,7 +15,7 @@ class CompressionSerializer(BaseSerializer): def dumps(self, value): print("I've received:\n{}".format(value)) compressed = zlib.compress(value.encode()) - print("But I'm storing:\n{}".format(compressed.decode("utf-8"))) + print("But I'm storing:\n{}".format(str(compressed))) return compressed def loads(self, value): From d0e88d598909e68b31f58e7cd0e4bb1cbf1f5bf7 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 14:25:48 +0000 Subject: [PATCH 04/27] Update serializer_class.py --- examples/serializer_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/serializer_class.py b/examples/serializer_class.py index b141c2d8..78e78e5e 100644 --- a/examples/serializer_class.py +++ b/examples/serializer_class.py @@ -15,7 +15,7 @@ class CompressionSerializer(BaseSerializer): def dumps(self, value): print("I've received:\n{}".format(value)) compressed = zlib.compress(value.encode()) - print("But I'm storing:\n{}".format(str(compressed))) + print("But I'm storing:\n{!r}".format(compressed)) return compressed def loads(self, value): From 791a8d1aee90cb58bd72fbe53806b061aebd7024 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 14:30:59 +0000 Subject: [PATCH 05/27] Update serializer_class.py --- examples/serializer_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/serializer_class.py b/examples/serializer_class.py index 78e78e5e..68a0943b 100644 --- a/examples/serializer_class.py +++ b/examples/serializer_class.py @@ -19,7 +19,7 @@ def dumps(self, value): return compressed def loads(self, value): - print("I've retrieved:\n{}".format(value)) + print("I've retrieved:\n{!r}".format(value)) decompressed = zlib.decompress(value).decode() print("But I'm returning:\n{}".format(decompressed)) return decompressed From b250f539f037a9d7dfa4406ccb874112c6c6191e Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 15:32:50 +0000 Subject: [PATCH 06/27] Update run_all.sh --- examples/run_all.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 5f45e8cd..ac358a22 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -4,7 +4,11 @@ pushd "$(dirname "$0")" for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" - python -bb -We -X dev $f || exit 1 + # ResourceWarning fails to exit 1, so we grep for warnings. + python -bb -We -X dev $f 2>&1 | tee /dev/tty | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + if [ ${PIPESTATUS[0]} -ne 0 ]; then + exit 1 + fi echo;echo;echo done From 71b065c924e227ea7e2487b351862d49271a366d Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 15:37:20 +0000 Subject: [PATCH 07/27] Update run_all.sh --- examples/run_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index ac358a22..1d073459 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -5,7 +5,7 @@ pushd "$(dirname "$0")" for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev $f 2>&1 | tee /dev/tty | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + python -bb -We -X dev $f 2>&1 | tee $(tty) | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi From 9ed339e1e4701ddd9a0a6372e88b161657f4735e Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 15:48:05 +0000 Subject: [PATCH 08/27] Update run_all.sh --- examples/run_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 1d073459..64a90fc0 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -5,7 +5,7 @@ pushd "$(dirname "$0")" for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev $f 2>&1 | tee $(tty) | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + python -bb -We -X dev $f 2>&1 | tee /dev/stderr | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi From 4cfada3aad7b01a0e071a147064d546006ea39c1 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 16:01:26 +0000 Subject: [PATCH 09/27] Update run_all.sh --- examples/run_all.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 64a90fc0..b5793bb7 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -5,7 +5,8 @@ pushd "$(dirname "$0")" for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev $f 2>&1 | tee /dev/stderr | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + tty=$(tty) + python -bb -We -X dev $f 2>&1 | tee $tty | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi From 6f0b5ba28419d83158fa56711fc17279c03bfc09 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 16:01:45 +0000 Subject: [PATCH 10/27] Update run_all.sh --- examples/run_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index b5793bb7..780c8567 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -2,10 +2,10 @@ pushd "$(dirname "$0")" +tty=$(tty) for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - tty=$(tty) python -bb -We -X dev $f 2>&1 | tee $tty | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 From effe17b3ac8db506b7240288ca289cac42d9b33d Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 16:06:10 +0000 Subject: [PATCH 11/27] Update run_all.sh --- examples/run_all.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 780c8567..64a90fc0 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -2,11 +2,10 @@ pushd "$(dirname "$0")" -tty=$(tty) for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev $f 2>&1 | tee $tty | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + python -bb -We -X dev $f 2>&1 | tee /dev/stderr | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi From 63ca524dfb5896f8d5d5c7b61eb089fc73fe7818 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:14:36 +0000 Subject: [PATCH 12/27] Update run_all.sh --- examples/run_all.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 64a90fc0..3b727b85 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -2,13 +2,10 @@ pushd "$(dirname "$0")" -for f in `find . -name '*.py' -not -path "./frameworks/*"`; do +for f in *.py; do echo "########## Running $f #########" # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev $f 2>&1 | tee /dev/stderr | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 - if [ ${PIPESTATUS[0]} -ne 0 ]; then - exit 1 - fi + python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda: os._exit(1); asyncio.run(${f%.*}.main())" || exit 1 echo;echo;echo done From f46f64b8f656f85558b799aed5f22d2183247367 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:15:23 +0000 Subject: [PATCH 13/27] Update run_all.sh --- examples/run_all.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 3b727b85..57fcb718 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -4,9 +4,7 @@ pushd "$(dirname "$0")" for f in *.py; do echo "########## Running $f #########" - # ResourceWarning fails to exit 1, so we grep for warnings. - python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda: os._exit(1); asyncio.run(${f%.*}.main())" || exit 1 - echo;echo;echo + python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda _: os._exit(1); asyncio.run(${f%.*}.main())" || exit 1 done popd From 0ba2a4555840902727881059bbcec05eda3fc4c8 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:19:33 +0000 Subject: [PATCH 14/27] Update cached_alias_config.py --- examples/cached_alias_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cached_alias_config.py b/examples/cached_alias_config.py index a22678ad..8ad82f08 100644 --- a/examples/cached_alias_config.py +++ b/examples/cached_alias_config.py @@ -51,7 +51,7 @@ async def alt_cache(): await cache.close() -async def test_alias(): +async def main() -> None: await default_cache() await alt_cache() @@ -63,4 +63,4 @@ async def test_alias(): if __name__ == "__main__": - asyncio.run(test_alias()) + asyncio.run(main()) From 113be21adce638d08a88d116dcedbbf8e52070f8 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:19:53 +0000 Subject: [PATCH 15/27] Update cached_decorator.py --- examples/cached_decorator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cached_decorator.py b/examples/cached_decorator.py index 72c53550..c66732c0 100644 --- a/examples/cached_decorator.py +++ b/examples/cached_decorator.py @@ -15,7 +15,7 @@ async def cached_call(): return Result("content", 200) -async def test_cached(): +async def main() -> None: async with Cache(Cache.REDIS, endpoint="127.0.0.1", port=6379, namespace="main") as cache: await cached_call() exists = await cache.exists("key") @@ -24,4 +24,4 @@ async def test_cached(): if __name__ == "__main__": - asyncio.run(test_cached()) + asyncio.run(main()) From 86a4b0f7c959add09a59bcb69b5ee7abd374c6bf Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:20:20 +0000 Subject: [PATCH 16/27] Update marshmallow_serializer_class.py --- examples/marshmallow_serializer_class.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/marshmallow_serializer_class.py b/examples/marshmallow_serializer_class.py index 5fd233c3..0a1c4129 100644 --- a/examples/marshmallow_serializer_class.py +++ b/examples/marshmallow_serializer_class.py @@ -54,10 +54,10 @@ async def serializer(): assert result.list_type == model.list_type -async def test_serializer(): +async def main() -> None: await serializer() await cache.delete("key") if __name__ == "__main__": - asyncio.run(test_serializer()) + asyncio.run(main()) From 819ffde95284d99fa523d9c27fe71ce9f9539946 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:20:44 +0000 Subject: [PATCH 17/27] Update multicached_decorator.py --- examples/multicached_decorator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/multicached_decorator.py b/examples/multicached_decorator.py index d05d5f4a..32d6e866 100644 --- a/examples/multicached_decorator.py +++ b/examples/multicached_decorator.py @@ -23,7 +23,7 @@ async def multi_cached_keys(keys=None): cache = Cache(Cache.REDIS, endpoint="127.0.0.1", port=6379, namespace="main") -async def test_multi_cached(): +async def main() -> None: await multi_cached_ids(ids=("a", "b")) await multi_cached_ids(ids=("a", "c")) await multi_cached_keys(keys=("d",)) @@ -41,4 +41,4 @@ async def test_multi_cached(): if __name__ == "__main__": - asyncio.run(test_multi_cached()) + asyncio.run(main()) From 5203cc894884beaf48f3ad0658d39ec5afff36d9 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:21:04 +0000 Subject: [PATCH 18/27] Update optimistic_lock.py --- examples/optimistic_lock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/optimistic_lock.py b/examples/optimistic_lock.py index 20624907..0f771318 100644 --- a/examples/optimistic_lock.py +++ b/examples/optimistic_lock.py @@ -36,11 +36,11 @@ async def concurrent(): await asyncio.gather(my_view(), my_view(), my_view()) -async def test_redis(): +async def main() -> None: await concurrent() await cache.delete("key") await cache.close() if __name__ == '__main__': - asyncio.run(test_redis()) + asyncio.run(main()) From 391d8462097153fff2f09872e194a87e1c37ddae Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:21:32 +0000 Subject: [PATCH 19/27] Update plugins.py --- examples/plugins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/plugins.py b/examples/plugins.py index b870d82b..e644b937 100644 --- a/examples/plugins.py +++ b/examples/plugins.py @@ -46,7 +46,7 @@ async def run(): print(cache.profiling) -async def test_run(): +async def main() -> None: await run() await cache.delete("a") await cache.delete("b") @@ -55,4 +55,4 @@ async def test_run(): if __name__ == "__main__": - asyncio.run(test_run()) + asyncio.run(main()) From bdfc8cc530cbed043cc51cd40000723ed3202af1 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:21:51 +0000 Subject: [PATCH 20/27] Update python_object.py --- examples/python_object.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/python_object.py b/examples/python_object.py index 8eea8b3b..c1971c1d 100644 --- a/examples/python_object.py +++ b/examples/python_object.py @@ -18,11 +18,11 @@ async def complex_object(): assert my_object.y == 2 -async def test_python_object(): +async def main() -> None: await complex_object() await cache.delete("key") await cache.close() if __name__ == "__main__": - asyncio.run(test_python_object()) + asyncio.run(main()) From b332806e699bb1c6905463946b8a5ab88ccdd389 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:22:12 +0000 Subject: [PATCH 21/27] Update redlock.py --- examples/redlock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/redlock.py b/examples/redlock.py index e763ddb3..466d62c4 100644 --- a/examples/redlock.py +++ b/examples/redlock.py @@ -32,11 +32,11 @@ async def concurrent(): await asyncio.gather(my_view(), my_view(), my_view()) -async def test_redis(): +async def main() -> None: await concurrent() await cache.delete("key") await cache.close() if __name__ == '__main__': - asyncio.run(test_redis()) + asyncio.run(main()) From 1d0912420b852440f6ffba7a056f691868071fb0 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:22:32 +0000 Subject: [PATCH 22/27] Update serializer_class.py --- examples/serializer_class.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/serializer_class.py b/examples/serializer_class.py index 68a0943b..d5912a36 100644 --- a/examples/serializer_class.py +++ b/examples/serializer_class.py @@ -43,11 +43,11 @@ async def serializer(): assert len(compressed_value) < len(real_value.encode()) -async def test_serializer(): +async def main() -> None: await serializer() await cache.delete("key") await cache.close() if __name__ == "__main__": - asyncio.run(test_serializer()) + asyncio.run(main()) From a6bdd4ea0a0fe1c532beff0c9dc3c7bba9da3a91 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:22:52 +0000 Subject: [PATCH 23/27] Update serializer_function.py --- examples/serializer_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/serializer_function.py b/examples/serializer_function.py index affa0b3b..4cfc477d 100644 --- a/examples/serializer_function.py +++ b/examples/serializer_function.py @@ -42,11 +42,11 @@ async def serializer_function(): assert json.loads(await cache.raw("get", "main:key")) == {"y": 2.0, "x": 1.0} -async def test_serializer_function(): +async def main() -> None: await serializer_function() await cache.delete("key") await cache.close() if __name__ == "__main__": - asyncio.run(test_serializer_function()) + asyncio.run(main()) From 313bc4a0f931ff8ee1fa7e8d2fedd226197c2453 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:23:11 +0000 Subject: [PATCH 24/27] Update simple_redis.py --- examples/simple_redis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/simple_redis.py b/examples/simple_redis.py index 2ff6278d..87faede3 100644 --- a/examples/simple_redis.py +++ b/examples/simple_redis.py @@ -15,7 +15,7 @@ async def redis(): assert await cache.raw("ttl", "main:expire_me") > 0 -async def test_redis(): +async def main() -> None: await redis() await cache.delete("key") await cache.delete("expire_me") @@ -23,4 +23,4 @@ async def test_redis(): if __name__ == "__main__": - asyncio.run(test_redis()) + asyncio.run(main()) From d1cb537035a0179f4b969ee29de623df6930cc89 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 31 Dec 2022 18:54:35 +0000 Subject: [PATCH 25/27] Update run_all.sh --- examples/run_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 57fcb718..561110f6 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -4,7 +4,7 @@ pushd "$(dirname "$0")" for f in *.py; do echo "########## Running $f #########" - python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda _: os._exit(1); asyncio.run(${f%.*}.main())" || exit 1 + python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda _: os._exit(1); asyncio.run(${f%.*}.main()); del ${f%.*}" || exit 1 done popd From 9ff5b095439be32bcad38858a48c55efce4b5dba Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 2 Jan 2023 16:42:16 +0000 Subject: [PATCH 26/27] Update run_all.sh --- examples/run_all.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 561110f6..89d6556f 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -2,9 +2,15 @@ pushd "$(dirname "$0")" -for f in *.py; do +for f in `find . -name '*.py' -not -path "./frameworks/*"`; do echo "########## Running $f #########" - python -bb -We -X dev -c "import asyncio, os, sys, ${f%.*}; sys.unraisablehook = lambda _: os._exit(1); asyncio.run(${f%.*}.main()); del ${f%.*}" || exit 1 + # ResourceWarning in __del__ fails to exit 1, so we grep for warnings. + # Did try using sys.unraisablehook, but it wasn't working. + python -bb -We -X dev $f 2>&1 | tee /dev/stderr | ( ! fgrep -i 'warning' > /dev/null ) || exit 1 + if [ ${PIPESTATUS[0]} -ne 0 ]; then + exit 1 + fi + echo;echo;echo done popd From d7a83bbb09db84f17a8732658d2fbe510eea9f5c Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 2 Jan 2023 16:46:05 +0000 Subject: [PATCH 27/27] Update run_all.sh --- examples/run_all.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/run_all.sh b/examples/run_all.sh index 89d6556f..9264faa2 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -10,7 +10,6 @@ for f in `find . -name '*.py' -not -path "./frameworks/*"`; do if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1 fi - echo;echo;echo done popd