From d059ddbb07f2a3ba817b58ea2098b69a5dfa5e9f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 May 2023 16:59:44 +0530 Subject: [PATCH] Only import resource module when actually running the test instead of at import time --- kitty_tests/crypto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty_tests/crypto.py b/kitty_tests/crypto.py index c4d24e1d8..aa9e251c6 100644 --- a/kitty_tests/crypto.py +++ b/kitty_tests/crypto.py @@ -3,7 +3,6 @@ import os -import unittest from . import BaseTest @@ -23,8 +22,9 @@ def is_rlimit_memlock_too_low() -> bool: class TestCrypto(BaseTest): - @unittest.skipIf(is_rlimit_memlock_too_low(), 'RLIMIT_MEMLOCK is too low') def test_elliptic_curve_data_exchange(self): + if is_rlimit_memlock_too_low(): + self.skipTest('RLIMIT_MEMLOCK is too low') from kitty.fast_data_types import AES256GCMDecrypt, AES256GCMEncrypt, CryptoError, EllipticCurveKey alice = EllipticCurveKey() bob = EllipticCurveKey()