aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/push.yml32
-rw-r--r--testsuite/pyunit/__init__.py14
-rw-r--r--testsuite/pyunit/dom/__init__.py13
-rw-r--r--testsuite/pyunit/libghdl/__init__.py13
-rw-r--r--testsuite/pyunit/pytest.ini7
-rw-r--r--testsuite/requirements.txt3
-rwxr-xr-xtestsuite/testsuite.sh4
7 files changed, 27 insertions, 59 deletions
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 55d1cc3e7..c7503450f 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -14,22 +14,22 @@ jobs:
# Format
#
- fmt:
- runs-on: ubuntu-latest
- name: '🐍 Format (black)'
- steps:
-
- - name: '🧰 Checkout'
- uses: actions/checkout@v2
-
- - name: '🐍 Setup Python'
- uses: actions/setup-python@v2
- with:
- python-version: 3.8
-
- - run: python -m pip install black
-
- - run: python -m black --check python
+# fmt:
+# runs-on: ubuntu-latest
+# name: '🐍 Format (black)'
+# steps:
+#
+# - name: '🧰 Checkout'
+# uses: actions/checkout@v2
+#
+# - name: '🐍 Setup Python'
+# uses: actions/setup-python@v2
+# with:
+# python-version: 3.8
+#
+# - run: python -m pip install black
+#
+# - run: python -m black --check python
#
# GPL
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_*
diff --git a/testsuite/requirements.txt b/testsuite/requirements.txt
index ce54b669b..f66ab3978 100644
--- a/testsuite/requirements.txt
+++ b/testsuite/requirements.txt
@@ -1,4 +1,7 @@
-r ../pyGHDL/requirements.txt
+pytest>=6.2.1
+pytest-cov>=2.10.1
+
# Coverage collection
Coverage>=5.3
diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh
index 55c2ff9fb..b1b69a7e2 100755
--- a/testsuite/testsuite.sh
+++ b/testsuite/testsuite.sh
@@ -141,9 +141,7 @@ do_gna () {
# The Python Unit testsuite: regression testsuite for Python bindings to libghdl
do_pyunit () {
gstart "[GHDL - test] pyunit"
- cd ..
- PYTHONPATH=$(pwd) python3 -m unittest testsuite.pyunit.libghdl.Initialize
- cd testsuite
+ PYTHONPATH=$(pwd)/.. python3 -m pytest pyunit
gend
}