python310Packages.pyasynchat: fix tests (#378792)

This commit is contained in:
Vladimír Čunát
2025-02-05 20:46:42 +01:00
@@ -5,6 +5,7 @@
setuptools,
pyasyncore,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
@@ -29,6 +30,17 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
preCheck =
if (pythonOlder "3.11") then
''
substituteInPlace tests/test_asynchat.py \
--replace-fail "asynchat = warnings_helper.import_deprecated('asynchat')" 'import asynchat' \
--replace-fail "asyncore = warnings_helper.import_deprecated('asyncore')" 'import asyncore' \
--replace-fail 'support.requires_working_socket(module=True)' ""
''
else
null;
pythonImportsCheck = [
"asynchat"
];