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 <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2025-10-29 17:17:41 +01:00
parent 68c5c606bc
commit 89e04610de
14 changed files with 55 additions and 174 deletions
+1 -6
View File
@@ -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
-16
View File
@@ -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:
@@ -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:
-16
View File
@@ -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:
@@ -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:
-16
View File
@@ -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:
@@ -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:
-14
View File
@@ -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()
+51
View File
@@ -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()
-14
View File
@@ -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()
-14
View File
@@ -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()
-14
View File
@@ -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()
-15
View File
@@ -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()
-14
View File
@@ -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()