From e2dfa7c77d26f4bd4985270f6c5e72852ab89311 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 12:05:36 +0100 Subject: [PATCH 01/13] Fix to travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6bb9f5a..d1f759e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - 2.7 install: -pip install --user -r requirements.txt +- pip install -r requirements.txt script: - pytest From 6af575143df8ff54b07a458fe7f5c0ae8c27e2b8 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 12:08:57 +0100 Subject: [PATCH 02/13] another fix --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ecf3e95..fbe2a93 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -PyQt4 +PyQt4 >= 4.11 From 3cdb2e06a2ec8712d04afc319c06a5b023a33904 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 14:14:39 +0100 Subject: [PATCH 03/13] another fix --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1f759e..c66abb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,11 @@ language: python python: - 2.7 +os: linux +dist: xenial + install: -- pip install -r requirements.txt +- apt-get install python-qt4 script: - pytest From c1aa9f28e297018d32ef9130e178e77cc5a48a87 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 14:16:56 +0100 Subject: [PATCH 04/13] another fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c66abb8..f21beed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: linux dist: xenial install: -- apt-get install python-qt4 +- sudo apt-get install python-qt4 script: - pytest From 45aea49eff0e58019e8b84f3c6e92dcf37b21aa4 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 14:21:38 +0100 Subject: [PATCH 05/13] another fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f21beed..a0903fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: os: linux dist: xenial -install: +before_install: - sudo apt-get install python-qt4 script: From 823da1c170f2de1784e2d266ff5dd73ef914a006 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 14:24:03 +0100 Subject: [PATCH 06/13] another fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a0903fe..eecaebe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: linux dist: xenial before_install: -- sudo apt-get install python-qt4 +- sudo apt-get install -y python-qt4 script: - pytest From 9fd64ff248be8afef871e6a05f8165ddecc8f67f Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 14:26:41 +0100 Subject: [PATCH 07/13] another fix --- requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fbe2a93..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -PyQt4 >= 4.11 From 4346a1cbe930138eb1fccbfe733bdd1b290dad71 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 15:06:41 +0100 Subject: [PATCH 08/13] another fix --- .travis.yml | 1 + equations.py | 10 +++++----- test_equations.py | 6 +----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index eecaebe..861aa99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ dist: xenial before_install: - sudo apt-get install -y python-qt4 +- sudo apt-get install python-pyside.qtwebkit script: - pytest diff --git a/equations.py b/equations.py index 0016e53..a05e19e 100755 --- a/equations.py +++ b/equations.py @@ -1187,7 +1187,7 @@ def prepareTextPuzzle(self, maxValue): # TODO: Add unit test , mandatory # Stephany has... relations = {"three more than": (1,3) ,"two more than": (1,2) ,"one more than" : (1,1), "one less than" : (1,-1), "two less than" : (1,-2), "three less than" : (1,-3), "twice as much as" : (2,0), "half of what" : (0.5, 0)} - relation = random.choice(relations.keys()) + relation = random.choice(list(relations.keys())) kasia_items, sum_items = self.computeAnswerAndTotal(relations[relation],maxValue) return relation, kasia_items, sum_items @@ -1274,11 +1274,11 @@ def makeDescriptionOfTextPuzzle(self,sumItems, relationText): def makeDescriptionOfBuyingPuzzle(self,item, zlotys, groszys): items = item + "s" price = "" - if zlotys <> "0": + if zlotys is not "0": price += zlotys+ " dollars " - if groszys <> "0": - if zlotys <> "0": + if groszys is not "0": + if zlotys is not "0": price += "and " price += groszys+ " cents " self.price = "= "+str(zlotys)+"."+str(groszys)+" $" @@ -1344,6 +1344,6 @@ def makeMazeSpeech(self): config.getMaximumBears(), # some initialization has to be done config.getContent()) else: - print "Daily limit exhausted" + print("Daily limit exhausted") stop = Stop(args) sys.exit(app.exec_()) diff --git a/test_equations.py b/test_equations.py index a5b3b5d..7f81a97 100644 --- a/test_equations.py +++ b/test_equations.py @@ -100,10 +100,6 @@ def testCalculateSectorIndex(qtbot): assert(equations.Maze(4,3).calculateSectorIndex(0,4) == "none") def testMaze(qtbot): -# testMaze = equations.Maze(3,3) -# qtbot.addWidget(testMaze) -# testMaze.show() -# time.sleep(1) class Args(): def __init__(self): self.dry_run = "Test" @@ -111,12 +107,12 @@ def __init__(self): testStop = equations.Stop(args) testStop.show() qtbot.addWidget(testStop) -# qtbot.waitExposed(testStop,1000) qtbot.waitForWindowShown(testStop) return def testClearSectors(qtbot): testMaze = equations.Maze(3,3) + qtbot.addWidget(testMaze) refTestMaze = equations.Maze(3,3) assert(refTestMaze.width == 3) assert(refTestMaze.height == 3) From 020c9d99f4dfa9e63a674ec92239d1bf1dd1a3c7 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 15:26:06 +0100 Subject: [PATCH 09/13] another fix --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..448ac40 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pytest-qt From 4deb070d51cf1aa45c65771e3ab7a8567114d7d8 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 15:30:18 +0100 Subject: [PATCH 10/13] another fix --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 448ac40..b46f4af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +Qt.py pytest-qt From cf5640f1716b0a409a2faeda77a7d4e0384f00ad Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 15:59:32 +0100 Subject: [PATCH 11/13] another fix --- .travis.yml | 3 +-- requirements.txt | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml index 861aa99..b0d8ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ language: python python: -- 2.7 +- 3.4 os: linux dist: xenial before_install: - sudo apt-get install -y python-qt4 -- sudo apt-get install python-pyside.qtwebkit script: - pytest diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b46f4af..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Qt.py -pytest-qt From 81728e68dc2f6613122c91900d9d6cae9be79a2f Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 16:03:58 +0100 Subject: [PATCH 12/13] another fix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b0d8ecb..85fa597 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ dist: xenial before_install: - sudo apt-get install -y python-qt4 +- sudo pip3 install pytest-qt script: - pytest From 4e4ae67a07061889ff693efad18710c776db04db Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Tue, 1 Jan 2019 16:06:33 +0100 Subject: [PATCH 13/13] another fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 85fa597..9428fac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ dist: xenial before_install: - sudo apt-get install -y python-qt4 -- sudo pip3 install pytest-qt +- sudo pip install pytest-qt script: - pytest