diff --git a/.travis.yml b/.travis.yml index 8b718d72..93a5935f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ dist: xenial -# services: -# - xvfb +services: + - xvfb language: python sudo: required addons: @@ -11,12 +11,12 @@ python: - "3.7" install: - pip install -r requirements.txt -# - pip install pytest-faulthandler + - pip install pytest-faulthandler - pip install pytest-cov -# - pip install pytest-qt + - pip install pytest-qt - pip install codecov script: -# - xvfb-run -a python -m pytest --cov=nw -m "project|core|gui" -v -s - - python -m pytest --cov=nw -m "project|core" -v + - xvfb-run -a python -m pytest --cov=nw -m "project|core|gui" -v -s +# - python -m pytest --cov=nw -m "project|core" -v after_success: - codecov diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..17f2ac93 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +markers = + project: Project classes tests + core: Core functionality tests + gui: Qt5 GUI tests + serial diff --git a/tests/test_gui.py b/tests/test_gui.py index 92c0d7c5..5f91550c 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -14,8 +14,8 @@ testRef = path.join(testDir,"reference") @pytest.mark.gui def testMainWindows(qtbot, tmpdir): - confDir = tmpdir.mkdir("conf") - projDir = tmpdir.mkdir("project") + confDir = str(tmpdir.mkdir("conf")) + projDir = str(tmpdir.mkdir("project")) nwGUI = nw.main(["--testmode","--config=%s" % confDir]) qtbot.addWidget(nwGUI) nwGUI.show() @@ -103,9 +103,9 @@ def testMainWindows(qtbot, tmpdir): qtbot.wait(stepDelay) # Check the files - projFile = projDir.join("nwProject.nwx") + projFile = str(projDir.join("nwProject.nwx")) assert cmpFiles(projFile, path.join(testRef,"gui_nwProject.nwx"), [2]) - sceneFile = projDir.join("data_3","1489056e0916_main.nwd") + sceneFile = str(projDir.join("data_3","1489056e0916_main.nwd")) assert cmpFiles(sceneFile, path.join(testRef,"gui_1489056e0916_main.nwd")) # qtbot.stopForInteraction()