Skip to content

Commit

Permalink
test/test_workchain.py
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 27, 2024
1 parent 92424ed commit 9e5c1ad
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions test/test_workchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def s6(self):
self.ctx.counter = self.ctx.counter + 1
self._set_finished(inspect.stack()[0][3])

def isA(self):
def isA(self): # noqa: N802
self._set_finished(inspect.stack()[0][3])
return self.inputs.value == 'A'

def isB(self):
def isB(self): # noqa: N802
self._set_finished(inspect.stack()[0][3])
return self.inputs.value == 'B'

def ltN(self):
def ltN(self): # noqa: N802
keep_looping = self.ctx.counter < self.inputs.n
if not keep_looping:
self._set_finished(inspect.stack()[0][3])
Expand Down Expand Up @@ -140,9 +140,9 @@ class TestWorkchain(unittest.TestCase):
maxDiff = None

def test_run(self):
A = 'A'
B = 'B'
C = 'C'
A = 'A' # noqa: N806
B = 'B' # noqa: N806
C = 'C' # noqa: N806
three = 3

# Try the if(..) part
Expand Down Expand Up @@ -195,8 +195,8 @@ def check_a_b(self):
Wf(inputs=dict(a=x, b=x)).execute()

def test_context(self):
A = 'a'
B = 'b'
A = 'a' # noqa: N806
B = 'b' # noqa: N806

class ReturnA(plumpy.Process):
@classmethod
Expand Down Expand Up @@ -254,9 +254,9 @@ def test_malformed_outline(self):
spec.outline(lambda x, y: 5)

def test_checkpointing(self):
A = 'A'
B = 'B'
C = 'C'
A = 'A' # noqa: N806
B = 'B' # noqa: N806
C = 'C' # noqa: N806
three = 3

# Try the if(..) part
Expand Down Expand Up @@ -310,7 +310,6 @@ def step2(self):

workchain = SimpleWorkChain()
workchain.add_process_listener(TestListener())
output = workchain.execute()

self.assertEqual(process_finished_count, 1)

Expand Down Expand Up @@ -435,7 +434,7 @@ async def async_test():
self.assertTrue(workchain.ctx.s2)

loop = asyncio.get_event_loop()
loop.create_task(workchain.step_until_terminated())
loop.create_task(workchain.step_until_terminated()) # noqa: RUF006
loop.run_until_complete(async_test())

def test_to_context(self):
Expand Down

0 comments on commit 9e5c1ad

Please sign in to comment.