Skip to content

Commit

Permalink
Further remove setUp() ..
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jan 28, 2025
1 parent 41e9ee6 commit 47b2e75
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 158 deletions.
3 changes: 1 addition & 2 deletions tests/base/test_statemachine.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import time
from typing import final
import unittest

from plumpy.base import state_machine
from plumpy.exceptions import InvalidStateError
Expand Down Expand Up @@ -148,7 +147,7 @@ def stop(self):
self.transition_to(Stopped(self))


class TestStateMachine(unittest.TestCase):
class TestStateMachine:
def test_basic(self):
cd_player = CdPlayer()
assert cd_player.state_label == STOPPED
Expand Down
3 changes: 1 addition & 2 deletions tests/base/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import unittest

from plumpy.base import utils
import pytest
Expand All @@ -24,7 +23,7 @@ def method(self):
pass


class TestSuperCheckMixin(unittest.TestCase):
class TestSuperCheckMixin:
def test_do_call(self):
DoCall().do()

Expand Down
3 changes: 1 addition & 2 deletions tests/persistence/test_inmemory.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
import unittest

import plumpy

from ..utils import ProcessWithCheckpoint


class TestInMemoryPersister(unittest.TestCase):
class TestInMemoryPersister:
def test_save_load_roundtrip(self):
"""
Test the plumpy.PicklePersister by taking a dummpy process, saving a checkpoint
Expand Down
3 changes: 1 addition & 2 deletions tests/persistence/test_pickle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import tempfile
import unittest

if getattr(tempfile, 'TemporaryDirectory', None) is None:
from backports import tempfile
Expand All @@ -10,7 +9,7 @@
from ..utils import ProcessWithCheckpoint


class TestPicklePersister(unittest.TestCase):
class TestPicklePersister:
def test_save_load_roundtrip(self):
"""
Test the plumpy.PicklePersister by taking a dummpy process, saving a checkpoint
Expand Down
3 changes: 1 addition & 2 deletions tests/test_expose.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import unittest

from plumpy.ports import PortNamespace
from plumpy.process_spec import ProcessSpec
Expand Down Expand Up @@ -45,7 +44,7 @@ def define(cls, spec):
spec.inputs.valid_type = int


class TestExposeProcess(unittest.TestCase):
class TestExposeProcess:
def check_ports(self, process, namespace, expected_port_names):
"""Check the port namespace of a given process inputs spec for existence of set of expected port names."""
port_namespace = process.spec().inputs
Expand Down
7 changes: 3 additions & 4 deletions tests/test_lang.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from plumpy.lang import override, protected

import unittest
import pytest


Expand Down Expand Up @@ -39,7 +38,7 @@ def testC(self): # noqa: N802
self.protected_property


class TestProtected(unittest.TestCase):
class TestProtected:
def test_free_function(self):
with pytest.raises(RuntimeError):

Expand Down Expand Up @@ -87,7 +86,7 @@ def test(self):
pass


class TestOverride(unittest.TestCase):
class TestOverride:
def test_free_function(self):
with pytest.raises(RuntimeError):

Expand Down Expand Up @@ -177,7 +176,7 @@ def test(self):
# def test(self):
# self._c_prime_called = True

# class TestCallSuper(unittest.TestCase):
# class TestCallSuper:
# def test_one_up(self):
# b = B()
# b.test()
Expand Down
5 changes: 2 additions & 3 deletions tests/test_persistence.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import asyncio
from typing import Any
import unittest

import yaml

Expand Down Expand Up @@ -102,7 +101,7 @@ def identify_object(self, obj: Any) -> str:
return super().identify_object(obj)


class TestSavable(unittest.TestCase):
class TestSavable:
def test_empty_savable(self):
self._save_round_trip(SaveEmpty())

Expand Down Expand Up @@ -148,7 +147,7 @@ def _save_round_trip_with_loader(self, savable):
assert saved_state1 != saved_state3


class TestBundle(unittest.TestCase):
class TestBundle:
def test_bundle_load_context(self):
"""Check that the loop from the load context is used"""
loop1 = asyncio.get_event_loop()
Expand Down
Loading

0 comments on commit 47b2e75

Please sign in to comment.