From 3c2254c335e9904c7c1647db1cd4ffd777a3f06b Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Tue, 20 Jun 2023 15:50:53 -0400 Subject: [PATCH] tox.ini: Add gui unit tests target Fix main unit tests to use envpython explicitly. Signed-off-by: Chris PeBenito --- tox.ini | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tox.ini b/tox.ini index e25fbd2..e1efe98 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ max-line-length = 100 deps = {[testenv]deps} pycodestyle commands_pre = pycodestyle --version -commands = pycodestyle setools/ setoolsgui/ tests/ seinfo seinfoflow sedta sesearch sediff sechecker apol --statistics +commands = pycodestyle setools/ setoolsgui/ tests/ tests-gui/ seinfo seinfoflow sedta sesearch sediff sechecker apol --statistics [testenv:coverage] setenv = SETOOLS_COVERAGE = 1 @@ -26,9 +26,10 @@ commands = coverage run -m pytest tests deps = {[testenv]deps} pylint>=2.8.0 PyQt5>=5.15.0 + pytest-qt commands_pre = pylint --version {envpython} setup.py build_ext -i -commands = pylint -E setools setoolsgui tests seinfo seinfoflow sedta sesearch sediff sechecker apol +commands = pylint -E setools setoolsgui tests tests-gui seinfo seinfoflow sedta sesearch sediff sechecker apol [testenv:mypy] deps = {[testenv]deps} @@ -36,20 +37,22 @@ deps = {[testenv]deps} PyQt5>=5.15.0 mypy commands_pre = mypy --version -commands = mypy -p setools - mypy -p setoolsgui - mypy seinfo - mypy seinfoflow - mypy sedta - mypy sesearch - mypy sediff - mypy sechecker - mypy apol +commands = mypy -p setools -p setoolsgui -p tests -p tests-gui + mypy --scripts-are-modules seinfo seinfoflow sedta sesearch sediff sechecker apol [testenv:install] deps = {[testenv]deps} commands = {envpython} -m pip install --use-pep517 . +[testenv:gui] +passenv = DISPLAY + XAUTHORITY +deps = {[testenv]deps} + PyQt5>=5.15.0 + pytest-qt + pytest-xvfb +commands = {envpython} -m pytest tests-gui + [testenv] passenv = USERSPACE_SRC deps = networkx>=2.0 @@ -60,4 +63,4 @@ deps = networkx>=2.0 python3.10: networkx>=2.6 python3.11: networkx>=2.6 commands_pre = {envpython} setup.py build_ext -i -commands = pytest tests +commands = {envpython} -m pytest tests