Commit 3ebd7ec6 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

flake8 linting

parent 3f8990b0
...@@ -51,7 +51,7 @@ class RouterActor(AbstractActor): ...@@ -51,7 +51,7 @@ class RouterActor(AbstractActor):
self.dictValues = {} self.dictValues = {}
def connect(self, actor, expectedValue="other"): def connect(self, actor, expectedValue="other"):
if expectedValue != "other" and not expectedValue in self.listPort: if expectedValue != "other" and expectedValue not in self.listPort:
raise RuntimeError( raise RuntimeError(
"Port {0} not defined for router actor {1}!".format( "Port {0} not defined for router actor {1}!".format(
expectedValue, self.name expectedValue, self.name
......
...@@ -33,7 +33,7 @@ try: ...@@ -33,7 +33,7 @@ try:
from bson.objectid import ObjectId from bson.objectid import ObjectId
USE_MONGODB = True USE_MONGODB = True
except: except ImportError:
print( print(
"Error when trying to import pymongo and/or bson - no MongoDB connection possible" "Error when trying to import pymongo and/or bson - no MongoDB connection possible"
) )
......
...@@ -25,7 +25,6 @@ __date__ = "28/05/2019" ...@@ -25,7 +25,6 @@ __date__ = "28/05/2019"
import os import os
import time
import pprint import pprint
import logging import logging
import pathlib import pathlib
......
...@@ -43,6 +43,6 @@ class TestThreadCountingActor(unittest.TestCase): ...@@ -43,6 +43,6 @@ class TestThreadCountingActor(unittest.TestCase):
] ]
state = {"ntasks": Counter()} state = {"ntasks": Counter()}
with ThreadPoolExecutor(max_workers=10) as executor: with ThreadPoolExecutor(max_workers=10) as executor:
results = executor.map(lambda w: w.trigger(state), workers3) executor.map(lambda w: w.trigger(state), workers3)
self.thread_counter.wait_threads_finished() self.thread_counter.wait_threads_finished()
self.assertEqual(state["ntasks"].value, 150) self.assertEqual(state["ntasks"].value, 150)
...@@ -62,7 +62,7 @@ class TestUtilsMongoDb(unittest.TestCase): ...@@ -62,7 +62,7 @@ class TestUtilsMongoDb(unittest.TestCase):
actorId1 = UtilsMongoDb.initActor(name=actorName1, workflowId=workflowId) actorId1 = UtilsMongoDb.initActor(name=actorName1, workflowId=workflowId)
self.assertIsNotNone(actorId1) self.assertIsNotNone(actorId1)
actorName2 = "TestActor2" actorName2 = "TestActor2"
actorId2 = UtilsMongoDb.initActor(name=actorName2, workflowId=workflowId) UtilsMongoDb.initActor(name=actorName2, workflowId=workflowId)
inData = {"a": 1} inData = {"a": 1}
UtilsMongoDb.addDataToActor( UtilsMongoDb.addDataToActor(
workflowId=workflowId, actorId=actorId1, actorData={"inData": inData} workflowId=workflowId, actorId=actorId1, actorData={"inData": inData}
......
...@@ -27,7 +27,6 @@ import logging ...@@ -27,7 +27,6 @@ import logging
import unittest import unittest
from pypushflow.Workflow import Workflow from pypushflow.Workflow import Workflow
from pypushflow.Submodel import Submodel
from pypushflow.StopActor import StopActor from pypushflow.StopActor import StopActor
from pypushflow.StartActor import StartActor from pypushflow.StartActor import StartActor
from pypushflow.PythonActor import PythonActor from pypushflow.PythonActor import PythonActor
......
...@@ -31,7 +31,6 @@ from pypushflow.Submodel import Submodel ...@@ -31,7 +31,6 @@ from pypushflow.Submodel import Submodel
from pypushflow.StopActor import StopActor from pypushflow.StopActor import StopActor
from pypushflow.StartActor import StartActor from pypushflow.StartActor import StartActor
from pypushflow.PythonActor import PythonActor from pypushflow.PythonActor import PythonActor
from pypushflow.ErrorHandler import ErrorHandler
from pypushflow.ThreadCounter import ThreadCounter from pypushflow.ThreadCounter import ThreadCounter
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment