From 78db8ed3f51bf792776d2213338a5cdfc920923d Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sat, 23 Jan 2016 08:13:32 +0530 Subject: [PATCH 1/3] Docs- 2.x instead of 3.x[ci_skip] --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6d731bd..b34f39e 100644 --- a/readme.md +++ b/readme.md @@ -71,7 +71,7 @@ Set ENV variable `PYTEST_STATUS_PORT` ### Contribution 1. Todo are currently tracked in todo.txt - I will probably move over some of it to gh issues, but it is invaluable for offline usage for me. I couldn't find a good service out there that allows file-based issue tracking with gh issue sync, but I certainly hope there is one. -2. Python 3.x tests seem to have an odd problem with Appveyor - py.test exits, but the tests machine doesn't shutdown as it apparently doesn't get the exit code, so it times out and fails. Whats interesting is that I thought after moving over to Tox this problem would be gone for good, but it didnt. Because it happens only in 3.x versions of python, it is probably because of something I have written and not their own bug. Maybe the db service is still running? But in my local windows machine, it doesn't + why only in 3.x versions of python? Can you help me with it? +2. Python 2.x tests seem to have an odd problem with Appveyor - py.test exits, but the tests machine doesn't shutdown as it apparently doesn't get the exit code, so it times out and fails. Whats interesting is that I thought after moving over to Tox this problem would be gone for good, but it didnt. Because it happens only in 2.x versions of python, it is probably because of something I have written and not their own bug. Maybe the db service is still running? But in my local windows machine, it doesn't + why only in 2.x versions of python? Can you help me with it? 3. Publishing to pypi is still a local and manual process - I would like to move that over to one of the CI servers with build and push triggered by a git tag. Also, it should build to as many pip formats as possible including zip, egg, (exe for win32 and win64). Duggan/pontoon has this mechanism, can you do the same for this? From fb536c993156e6b27a6b69e5d1a4e5c04f997cf2 Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sat, 23 Jan 2016 22:48:28 +0530 Subject: [PATCH 2/3] Remove unused import --- pytest_gui_status/status_gui/gui_backend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pytest_gui_status/status_gui/gui_backend.py b/pytest_gui_status/status_gui/gui_backend.py index 66398d3..725910e 100644 --- a/pytest_gui_status/status_gui/gui_backend.py +++ b/pytest_gui_status/status_gui/gui_backend.py @@ -8,7 +8,6 @@ import humanfriendly import os.path from ..utils import s from ..utils import REDIS_PORT -from PyQt4.QtGui import QApplication class Controller(htmlPy.Object): From a43aa5f68c83b753e6f29e2def8b51da273268c2 Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sat, 23 Jan 2016 23:14:38 +0530 Subject: [PATCH 3/3] Revert window pos set to start + add tmpl_name to all fake_app_gui --- pytest_gui_status/status_gui/gui_backend.py | 5 ----- pytest_gui_status/status_gui/gui_frontend.py | 6 ++++++ tests/test_gui/test_gui.py | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pytest_gui_status/status_gui/gui_backend.py b/pytest_gui_status/status_gui/gui_backend.py index 725910e..597787d 100644 --- a/pytest_gui_status/status_gui/gui_backend.py +++ b/pytest_gui_status/status_gui/gui_backend.py @@ -44,11 +44,6 @@ class Controller(htmlPy.Object): # self.app_gui.window.minimumWidth, self.app_gui.window.minimumHeight = (0, 0) self.app_gui.width, self.app_gui.height = self.dict_tmpl_size.get(self.app_gui.tmpl_name) - screen_geo = QApplication.desktop().availableGeometry() - screen_topright = screen_geo.topRight() - self.app_gui.x_pos = (screen_topright.x() - 20) - self.app_gui.width - self.app_gui.y_pos = (screen_topright.y() + 20) - @htmlPy.Slot() def redraw(self): redis_db = redis.StrictRedis(host='localhost', port=REDIS_PORT, db=0) diff --git a/pytest_gui_status/status_gui/gui_frontend.py b/pytest_gui_status/status_gui/gui_frontend.py index 4d0223c..ed3f189 100644 --- a/pytest_gui_status/status_gui/gui_frontend.py +++ b/pytest_gui_status/status_gui/gui_frontend.py @@ -2,6 +2,7 @@ import htmlPy import os import PyQt4.QtCore as QtCore +from PyQt4.QtGui import QApplication import argparse # Import back-end functionalities @@ -32,6 +33,11 @@ def main(): # app.window.setWindowFlags(app.window.windowFlags() & ~QtCore.Qt.WindowMaximizeButtonHint) app.window.setWindowFlags(app.window.windowFlags() | QtCore.Qt.WindowStaysOnTopHint) + screen_geo = QApplication.desktop().availableGeometry() + screen_topright = screen_geo.topRight() + app.x_pos = (screen_topright.x() - 20) - app.width + app.y_pos = (screen_topright.y() + 20) + # GUI configarg BASE_DIR = os.path.abspath(os.path.dirname(__file__)) app.static_path = os.path.join(BASE_DIR, "static/") diff --git a/tests/test_gui/test_gui.py b/tests/test_gui/test_gui.py index f8d1967..e1a519b 100644 --- a/tests/test_gui/test_gui.py +++ b/tests/test_gui/test_gui.py @@ -73,6 +73,7 @@ class TestRedisFail(object): # mock Controller requirements and app_gui.stop fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" with pytest.raises(redis.exceptions.ConnectionError) as error_info: gui_backend.Controller(fake_app_gui).redraw() @@ -97,6 +98,7 @@ class TestRedisFail(object): # mock Controller requirements and app_gui.stop fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" with pytest.raises(redis.exceptions.ConnectionError) as error_info: gui_backend.Controller(fake_app_gui).redraw() @@ -123,6 +125,7 @@ class TestRedisFail(object): # mock Controller requirements and app_gui.stop fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" with pytest.raises(redis.exceptions.ConnectionError) as error_info: gui_backend.Controller(fake_app_gui).redraw() @@ -149,6 +152,7 @@ class TestRedisFail(object): # mock Controller requirements and app_gui.stop # provide invalid path fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" fake_app_gui.dir_name = r"Invalid/Path" with pytest.raises(redis.exceptions.ConnectionError) as error_info: @@ -185,6 +189,7 @@ class TestBackendState(object): # mock app_gui with path fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" fake_app_gui.dir_name = tmpdir.strpath tmp_controller = gui_backend.Controller(fake_app_gui) @@ -224,6 +229,7 @@ class TestBackendState(object): # mock app_gui with path fake_app_gui = MagicMock() + fake_app_gui.tmpl_name = "default" fake_app_gui.dir_name = tmpdir.strpath tmp_controller = gui_backend.Controller(fake_app_gui)