summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-cryptography/check-memfree.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-03-21 12:37:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-21 22:42:05 +0000
commit60e764f77238eff72d5c589b83f12329d393ea9b (patch)
tree82138d353e72b48ea980e2b6e39e3c6725ab737f /meta/recipes-devtools/python/python3-cryptography/check-memfree.py
parentc2a663ebd7e0e319165a50c5fb4bdae898d85f4a (diff)
downloadpoky-60e764f77238eff72d5c589b83f12329d393ea9b.tar.gz
python3-cryptography: use python3-unittest-automake-output
Instead of using sed to reformat the output use this new module. This shows that the previous sed expression wasn't sufficient because it didn't handle tests throwing an error, and now the bench/ tests fail because we don't have pytest-benchmark. These tests are more of a benchmark than a unit test, so just skip them. Also show a skip message instead of nothing if the tests were skipped due to a lack of memory. (From OE-Core rev: f22b60676159f729c081ba62fba4642629daa914) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3-cryptography/check-memfree.py')
-rwxr-xr-xmeta/recipes-devtools/python/python3-cryptography/check-memfree.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-devtools/python/python3-cryptography/check-memfree.py b/meta/recipes-devtools/python/python3-cryptography/check-memfree.py
index c111a9074c..ed680d8d5b 100755
--- a/meta/recipes-devtools/python/python3-cryptography/check-memfree.py
+++ b/meta/recipes-devtools/python/python3-cryptography/check-memfree.py
@@ -4,7 +4,7 @@ import sys
4meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines()) 4meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines())
5mem_free = meminfo['MemTotal']/1024./1024. 5mem_free = meminfo['MemTotal']/1024./1024.
6if mem_free < 2.: 6if mem_free < 2.:
7 raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free)) 7 print("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
8 sys.exit(1) 8 sys.exit(1)
9else: 9else:
10 print("Free memory: {:.3f} GB".format(mem_free)) 10 print("Free memory: {:.3f} GB".format(mem_free))