From 4b1c45ddb453d8a74f813b30060950b6c72b39cd Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:01:41 +0200 Subject: [PATCH] Fixed coverage in actions and updated launch test --- .github/workflows/test_linux_3.8.yml | 2 +- .github/workflows/test_mac.yml | 2 +- .github/workflows/test_win.yml | 2 +- nw/__init__.py | 32 +++++++++++----------- tests/test_gui.py | 40 +++++++++++++++++++++++----- 5 files changed, 53 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test_linux_3.8.yml b/.github/workflows/test_linux_3.8.yml index 502de464..dd27ce70 100644 --- a/.github/workflows/test_linux_3.8.yml +++ b/.github/workflows/test_linux_3.8.yml @@ -32,6 +32,6 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --timeout=60 + pytest -v --cov-nw --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_mac.yml b/.github/workflows/test_mac.yml index 0478bf71..d409f81e 100644 --- a/.github/workflows/test_mac.yml +++ b/.github/workflows/test_mac.yml @@ -31,6 +31,6 @@ jobs: - name: Run Tests run: | export QT_QPA_PLATFORM=offscreen - pytest -v --timeout=60 + pytest -v --cov-nw --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_win.yml b/.github/workflows/test_win.yml index aa9ef284..ebdee693 100644 --- a/.github/workflows/test_win.yml +++ b/.github/workflows/test_win.yml @@ -27,6 +27,6 @@ jobs: pip install codecov - name: Run Tests run: | - pytest -v --timeout=60 + pytest -v --cov-nw --timeout=60 - name: Upload to Codecov uses: codecov/codecov-action@v1 diff --git a/nw/__init__.py b/nw/__init__.py index 199d20ca..aa755a2e 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -28,7 +28,6 @@ import sys import getopt import logging -import os from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QErrorMessage @@ -158,12 +157,12 @@ def main(sysArgs=None): for inOpt, inArg in inOpts: if inOpt in ("-h", "--help"): print(helpMsg) - sys.exit() + sys.exit(0) elif inOpt in ("-v", "--version"): print("novelWriter %s Version %s [%s]" % ( __status__, __version__, __date__) ) - sys.exit() + sys.exit(0) elif inOpt == "--info": debugLevel = logging.INFO elif inOpt == "--debug": @@ -224,19 +223,20 @@ def main(sysArgs=None): errorData.append("Python module 'lxml' is missing.") if errorData: - errApp = QApplication([]) - errMsg = QErrorMessage() - errMsg.resize(500, 300) - errMsg.showMessage(( - "
novelWriter cannot start due to the following issues:
" - "
- %s
" - "Shutting down ...
" - ) % ( - "novelWriter cannot start due to the following issues:
" + "
- %s
" + "Shutting down ...
" + ) % ( + "