pyuno/Module_pyuno.mk | 7 --- pyuno/PythonTest_pyuno_pytests_testbz2.mk | 16 ------- pyuno/PythonTest_pyuno_pytests_testimports.mk | 6 +- pyuno/PythonTest_pyuno_pytests_testpip.mk | 16 ------- pyuno/PythonTest_pyuno_pytests_testsetuptools.mk | 16 ------- pyuno/PythonTest_pyuno_pytests_testssl.mk | 16 ------- pyuno/PythonTest_pyuno_pytests_testvenv.mk | 16 ------- pyuno/qa/pytests/testbz2.py | 14 ------ pyuno/qa/pytests/testimports.py | 51 +++++++++++++++++++++++ pyuno/qa/pytests/testpip.py | 14 ------ pyuno/qa/pytests/testsetuptools.py | 14 ------ pyuno/qa/pytests/testsqlite3.py | 14 ------ pyuno/qa/pytests/testssl.py | 15 ------ pyuno/qa/pytests/testvenv.py | 14 ------ 14 files changed, 55 insertions(+), 174 deletions(-)
New commits: commit 89e04610def8cf3bc142cd4aa770b61e51055f24 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Oct 29 14:48:42 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Oct 29 17:17:41 2025 +0100 pyuno: Combine all import tests into one file It makes it easier to add new ones Change-Id: Icfea450bf4e6b6efb4d4a9644706303b2e8059a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193154 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk index c5cf0371050e..fc84a52ef89f 100644 --- a/pyuno/Module_pyuno.mk +++ b/pyuno/Module_pyuno.mk @@ -45,12 +45,7 @@ $(eval $(call gb_Module_add_targets,pyuno,\ endif $(eval $(call gb_Module_add_check_targets,pyuno, \ - PythonTest_pyuno_pytests_testssl \ - PythonTest_pyuno_pytests_testbz2 \ - PythonTest_pyuno_pytests_testpip \ - PythonTest_pyuno_pytests_testsetuptools \ - PythonTest_pyuno_pytests_testsqlite3 \ - PythonTest_pyuno_pytests_testvenv \ + PythonTest_pyuno_pytests_testimports \ )) endif # !SYSTEM_PYTHON diff --git a/pyuno/PythonTest_pyuno_pytests_testbz2.mk b/pyuno/PythonTest_pyuno_pytests_testbz2.mk deleted file mode 100644 index 0f881068c541..000000000000 --- a/pyuno/PythonTest_pyuno_pytests_testbz2.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_testbz2)) - -$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testbz2,$(SRCDIR)/pyuno/qa/pytests,\ - testbz2 \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/pyuno/PythonTest_pyuno_pytests_testsqlite3.mk b/pyuno/PythonTest_pyuno_pytests_testimports.mk similarity index 66% rename from pyuno/PythonTest_pyuno_pytests_testsqlite3.mk rename to pyuno/PythonTest_pyuno_pytests_testimports.mk index 6a1ed36c5621..503f8c1b9cb1 100644 --- a/pyuno/PythonTest_pyuno_pytests_testsqlite3.mk +++ b/pyuno/PythonTest_pyuno_pytests_testimports.mk @@ -7,10 +7,10 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testsqlite3)) +$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testimports)) -$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testsqlite3,$(SRCDIR)/pyuno/qa/pytests,\ - testsqlite3 \ +$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testimports,$(SRCDIR)/pyuno/qa/pytests,\ + testimports \ )) # vim: set noet sw=4 ts=4: diff --git a/pyuno/PythonTest_pyuno_pytests_testpip.mk b/pyuno/PythonTest_pyuno_pytests_testpip.mk deleted file mode 100644 index b3e2ed4fb47d..000000000000 --- a/pyuno/PythonTest_pyuno_pytests_testpip.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_testpip)) - -$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testpip,$(SRCDIR)/pyuno/qa/pytests,\ - testpip \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk b/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk deleted file mode 100644 index 797aef2dac6c..000000000000 --- a/pyuno/PythonTest_pyuno_pytests_testsetuptools.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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/PythonTest_pyuno_pytests_testssl.mk b/pyuno/PythonTest_pyuno_pytests_testssl.mk deleted file mode 100644 index e431af31a228..000000000000 --- a/pyuno/PythonTest_pyuno_pytests_testssl.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_testssl)) - -$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testssl,$(SRCDIR)/pyuno/qa/pytests,\ - testssl \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/pyuno/PythonTest_pyuno_pytests_testvenv.mk b/pyuno/PythonTest_pyuno_pytests_testvenv.mk deleted file mode 100644 index 26eaf99aed30..000000000000 --- a/pyuno/PythonTest_pyuno_pytests_testvenv.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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_testvenv)) - -$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testvenv,$(SRCDIR)/pyuno/qa/pytests,\ - testvenv \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/pyuno/qa/pytests/testbz2.py b/pyuno/qa/pytests/testbz2.py deleted file mode 100644 index 12a44e14bb09..000000000000 --- a/pyuno/qa/pytests/testbz2.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import unittest - -# tdf#116412: make sure importing bz2 works on all platforms -class BZ2Test(unittest.TestCase): - def test_bz2_import(self): - import bz2 - - # use imported bz2 module for pyflakes - with open(os.devnull, "w") as devnull: - print(str(bz2), file=devnull) - -if __name__ == '__main__': - unittest.main() diff --git a/pyuno/qa/pytests/testimports.py b/pyuno/qa/pytests/testimports.py new file mode 100644 index 000000000000..8d58f97abc03 --- /dev/null +++ b/pyuno/qa/pytests/testimports.py @@ -0,0 +1,51 @@ +import os +import unittest + +class ImportsTest(unittest.TestCase): + def test_sqlite3_import(self): + import sqlite3 + + # use imported sqlite3 module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(sqlite3), file=devnull) + + # tdf#116412: make sure importing bz2 works on all platforms + def test_bz2_import(self): + import bz2 + + # use imported bz2 module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(bz2), file=devnull) + + # tdf#161947: make sure importing setuptools works on all platforms + 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) + + def test_ssl_import(self): + import ssl + + # use imported ssl module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(ssl), file=devnull) + + # tdf#162786: make sure importing pip works on all platforms + def test_pip_import(self): + import pip + + # use imported pip module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(pip), file=devnull) + + def test_venv_import(self): + import venv + + # use imported venv module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(venv), file=devnull) + +if __name__ == '__main__': + unittest.main() diff --git a/pyuno/qa/pytests/testpip.py b/pyuno/qa/pytests/testpip.py deleted file mode 100644 index 867af8879973..000000000000 --- a/pyuno/qa/pytests/testpip.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import unittest - -# tdf#162786: make sure importing pip works on all platforms -class SetupToolsTest(unittest.TestCase): - def test_pip_import(self): - import pip - - # use imported pip module for pyflakes - with open(os.devnull, "w") as devnull: - print(str(pip), file=devnull) - -if __name__ == '__main__': - unittest.main() diff --git a/pyuno/qa/pytests/testsetuptools.py b/pyuno/qa/pytests/testsetuptools.py deleted file mode 100644 index 9439a1216120..000000000000 --- a/pyuno/qa/pytests/testsetuptools.py +++ /dev/null @@ -1,14 +0,0 @@ -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() diff --git a/pyuno/qa/pytests/testsqlite3.py b/pyuno/qa/pytests/testsqlite3.py deleted file mode 100644 index bf515d351f02..000000000000 --- a/pyuno/qa/pytests/testsqlite3.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import unittest - -# I want to ensure that import sqlite3 works on all platforms -class SQLITE3Test(unittest.TestCase): - def test_sqlite3_import(self): - import sqlite3 - - # use imported sqlite3 module for pyflakes - with open(os.devnull, "w") as devnull: - print(str(sqlite3), file=devnull) - -if __name__ == '__main__': - unittest.main() diff --git a/pyuno/qa/pytests/testssl.py b/pyuno/qa/pytests/testssl.py deleted file mode 100644 index d29066ffe39e..000000000000 --- a/pyuno/qa/pytests/testssl.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import unittest - - -# I want to ensure that import ssl works on all platforms -class SSLTest(unittest.TestCase): - def test_ssl_import(self): - import ssl - - # use imported ssl module for pyflakes - with open(os.devnull, "w") as devnull: - print(str(ssl), file=devnull) - -if __name__ == '__main__': - unittest.main() diff --git a/pyuno/qa/pytests/testvenv.py b/pyuno/qa/pytests/testvenv.py deleted file mode 100644 index 2a72dfd4a9d7..000000000000 --- a/pyuno/qa/pytests/testvenv.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import unittest - -# I want to ensure that import venv works on all platforms -class VENVTest(unittest.TestCase): - def test_venv_import(self): - import venv - - # use imported venv module for pyflakes - with open(os.devnull, "w") as devnull: - print(str(venv), file=devnull) - -if __name__ == '__main__': - unittest.main()
