Skip to content

Commit

Permalink
style: remove all explicit object inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Oct 31, 2021
1 parent 945b9c5 commit 648d82b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bumpr/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)


class Hook(object):
class Hook:
key: str = ""
defaults: dict[str, Optional[str]] = {}

Expand Down
2 changes: 1 addition & 1 deletion bumpr/releaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
logger = logging.getLogger(__name__)


class Releaser(object):
class Releaser:
"""
Release workflow executor
"""
Expand Down
2 changes: 1 addition & 1 deletion bumpr/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MSG = "The current repository contains modified files"


class BaseVCS(object):
class BaseVCS:
def __init__(self, verbose=False):
self.verbose = verbose

Expand Down
2 changes: 1 addition & 1 deletion bumpr/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re


class Version(object):
class Version:
MAJOR, MINOR, PATCH = range(3)

PATTERN = re.compile(r"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<suffix>[\w\d.]+))?")
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def pytest_configure():
DEFAULT_VERSION = "1.2.3.dev"


class Workspace(object):
class Workspace:
def __init__(self, root, version):
self.module_name = "fake"
self.root = root
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def bumprc(request, mocker, mock_ini):


@pytest.mark.usefixtures("bumprc")
class ConfigTest(object):
class ConfigTest:
@pytest.fixture(autouse=True)
def cleandir(self, tmpdir):
tmpdir.chdir()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def check_output_mock(mocker):
yield mocker.patch("bumpr.helpers.check_output")


class ExecuteTest(object):
class ExecuteTest:
def test_execute_quiet(self, check_call, check_output):
output = "some output"
check_output.return_value = output
Expand Down
12 changes: 6 additions & 6 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from bumpr.version import Version


class ReadTheDocHookDefaultTest(object):
class ReadTheDocHookDefaultTest:
@pytest.fixture(autouse=True)
def setUp(self, workspace, mocker):
self.releaser = mocker.MagicMock()
Expand Down Expand Up @@ -47,7 +47,7 @@ def test_prepare(self):
]


class ReadTheDocHookCustomTest(object):
class ReadTheDocHookCustomTest:
@pytest.fixture(autouse=True)
def setUp(self, mocker):
self.releaser = mocker.MagicMock()
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_prepare(self):
]


class ReadTheDocHookCustomTagTest(object):
class ReadTheDocHookCustomTagTest:
@pytest.fixture(autouse=True)
def setUp(self, workspace, mocker):
self.releaser = mocker.MagicMock()
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_prepare(self):
]


class CommandsHookTest(object):
class CommandsHookTest:
@pytest.fixture(autouse=True)
def setUp(self, mocker):
self.releaser = mocker.MagicMock()
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_prepare_dryrun(self, mocker):
)


class ChangelogHookTest(object):
class ChangelogHookTest:
@pytest.fixture(autouse=True)
def setUp(self, mocker):
self.releaser = mocker.MagicMock()
Expand Down Expand Up @@ -346,7 +346,7 @@ def test_prepare_no_separator(self, workspace):
self.releaser.perform.assert_called_once_with("changelog", content, expected)


class ReplaceHookTest(object):
class ReplaceHookTest:
@pytest.fixture(autouse=True)
def setUp(self, mocker):
self.releaser = mocker.MagicMock()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from bumpr.vcs import BaseVCS, Bazaar, Git, Mercurial


class BaseVCSTest(object):
class BaseVCSTest:
def test_execute_verbose(self, mocker):
vcs = BaseVCS(verbose=True)
execute = mocker.patch("bumpr.vcs.execute")
Expand All @@ -20,7 +20,7 @@ def test_execute_quiet(self, mocker):
execute.assert_called_with("cmd arg", verbose=False)


class GitTest(object):
class GitTest:
def test_validate_ok(self, workspace, mocker):
workspace.mkdir(".git")
git = Git()
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_push(self, mocker):
execute.assert_any_call(["git", "push", "--tags"])


class MercurialTest(object):
class MercurialTest:
def test_validate_ok(self, workspace, mocker):
workspace.mkdir(".hg")
mercurial = Mercurial()
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_push(self, mocker):
execute.assert_called_with(["hg", "push"])


class BazaarTest(object):
class BazaarTest:
def test_validate_ok(self, workspace, mocker):
workspace.mkdir(".bzr")
bazaar = Bazaar()
Expand Down

0 comments on commit 648d82b

Please sign in to comment.