diff --git a/.travis.yml b/.travis.yml index 6bb9f5a..9428fac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ language: python python: -- 2.7 +- 3.4 -install: -pip install --user -r requirements.txt +os: linux +dist: xenial + +before_install: +- sudo apt-get install -y python-qt4 +- sudo pip install pytest-qt 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/requirements.txt b/requirements.txt deleted file mode 100644 index ecf3e95..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -PyQt4 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)