From f9cd7e2801e7bbc620521f2ce3ee4be4c66cdc21 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 9 Jul 2024 01:40:23 +0200 Subject: [PATCH] tdf#161947: test setuptools is imported on mac Change-Id: Ie0908e610b3eade41aa5e7f1953ddaa55afce68d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170173 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- pyuno/Module_pyuno.mk | 6 ++++++ pyuno/PythonTest_pyuno_pytests_testsetuptools.mk | 16 ++++++++++++++++ pyuno/qa/pytests/testsetuptools.py | 14 ++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 pyuno/PythonTest_pyuno_pytests_testsetuptools.mk create mode 100644 pyuno/qa/pytests/testsetuptools.py diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk index fac159e2ced3..3a12fc68efac 100644 --- a/pyuno/Module_pyuno.mk +++ b/pyuno/Module_pyuno.mk @@ -51,6 +51,12 @@ $(eval $(call gb_Module_add_check_targets,pyuno, \ PythonTest_pyuno_pytests_testbz2 \ )) +ifeq ($(OS),MACOSX) +$(eval $(call gb_Module_add_check_targets,pyuno, \ + PythonTest_pyuno_pytests_testsetuptools \ +)) +endif + $(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \ PythonTest_pyuno_pytests_testcollections \ PythonTest_pyuno_pytests_insertremovecells \ diff --git a/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk b/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk new file mode 100644 index 000000000000..797aef2dac6c --- /dev/null +++ b/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testsetuptools)) + +$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testsetuptools,$(SRCDIR)/pyuno/qa/pytests,\ + testsetuptools \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/pyuno/qa/pytests/testsetuptools.py b/pyuno/qa/pytests/testsetuptools.py new file mode 100644 index 000000000000..9439a1216120 --- /dev/null +++ b/pyuno/qa/pytests/testsetuptools.py @@ -0,0 +1,14 @@ +import os +import unittest + +# tdf#161947: make sure importing setuptools works on all platforms +class SetupToolsTest(unittest.TestCase): + def test_setuptools_import(self): + import setuptools + + # use imported setuptools module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(setuptools), file=devnull) + +if __name__ == '__main__': + unittest.main()