diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2020-12-30 18:08:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-30 18:08:39 +0100 |
commit | 286d064a61a83ff39a389f96be86966977458a52 (patch) | |
tree | ad252dd22aba6afe37fe667bc9188f5262d03bb0 /testsuite/pyunit | |
parent | fbe43ad4dc8451fecba5318af97541283207a0e8 (diff) | |
download | ghdl-286d064a61a83ff39a389f96be86966977458a52.tar.gz ghdl-286d064a61a83ff39a389f96be86966977458a52.tar.bz2 ghdl-286d064a61a83ff39a389f96be86966977458a52.zip |
Executing Python unit tests in Parallel Processes (#1558)
* Prepare pyunit tests for parallel and independent execution with pytest/pytest-forked.
* Added forked pytest test executions.
* Added a pytest ini-file
* Corrected pytest settings.
* Adjusting PYTHONPATH.
* Reverted changes required for pytest without modified file search patterns.
(cherry picked from commit 0207b11cfef029f2ed765df3ad983ef47cc0838b)
* Run pyunit tests without '--forked'.
* Deactivate black.
(cherry picked from commit d6b68588d4de26bf94181ea726be969cd09aadf0)
Diffstat (limited to 'testsuite/pyunit')
-rw-r--r-- | testsuite/pyunit/__init__.py | 14 | ||||
-rw-r--r-- | testsuite/pyunit/dom/__init__.py | 13 | ||||
-rw-r--r-- | testsuite/pyunit/libghdl/__init__.py | 13 | ||||
-rw-r--r-- | testsuite/pyunit/pytest.ini | 7 |
4 files changed, 7 insertions, 40 deletions
diff --git a/testsuite/pyunit/__init__.py b/testsuite/pyunit/__init__.py index eff53eb2f..e69de29bb 100644 --- a/testsuite/pyunit/__init__.py +++ b/testsuite/pyunit/__init__.py @@ -1,14 +0,0 @@ -from unittest import TestSuite - -try: - from testsuite.pyunit import libghdl, dom -except ModuleNotFoundError: - from pyunit import libghdl, dom - -def load_tests(loader, testCases, pattern): - suite = TestSuite() - - suite.addTests(loader.loadTestsFromModule(libghdl)) - suite.addTests(loader.loadTestsFromModule(dom)) - - return suite diff --git a/testsuite/pyunit/dom/__init__.py b/testsuite/pyunit/dom/__init__.py index 9c103eb6a..e69de29bb 100644 --- a/testsuite/pyunit/dom/__init__.py +++ b/testsuite/pyunit/dom/__init__.py @@ -1,13 +0,0 @@ -from unittest import TestSuite - -try: - from testsuite.pyunit.dom import SimpleEntity -except ModuleNotFoundError: - from pyunit.dom import SimpleEntity - -def load_tests(loader, testCases, pattern): - suite = TestSuite() - - suite.addTests(loader.loadTestsFromModule(SimpleEntity)) - - return suite diff --git a/testsuite/pyunit/libghdl/__init__.py b/testsuite/pyunit/libghdl/__init__.py index 4aeab3ec3..e69de29bb 100644 --- a/testsuite/pyunit/libghdl/__init__.py +++ b/testsuite/pyunit/libghdl/__init__.py @@ -1,13 +0,0 @@ -from unittest import TestSuite - -try: - from testsuite.pyunit.libghdl import Initialize -except ModuleNotFoundError: - from pyunit.libghdl import Initialize - -def load_tests(loader, testCases, pattern): - suite = TestSuite() - - suite.addTests(loader.loadTestsFromModule(Initialize)) - - return suite diff --git a/testsuite/pyunit/pytest.ini b/testsuite/pyunit/pytest.ini new file mode 100644 index 000000000..e00478651 --- /dev/null +++ b/testsuite/pyunit/pytest.ini @@ -0,0 +1,7 @@ +[pytest] +addopts = -rA + +# Don't set 'python_classes = *' otherwise, pytest doesn't search for classes +# derived from unittest.Testcase +python_files = * +python_functions = test_* |