Skip to content

Commit

Permalink
Merge branch 'main' into 906-int
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Feb 17, 2023
2 parents e01da1a + 6f9f35c commit e956312
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/concepts/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ you're done::

class MyProgram(Program):
def core_args(self):
core_args = super(MyProgram, self).core_args()
core_args = super().core_args()
extra_args = [
Argument(names=('foo', 'f'), help="Foo the bars"),
# ...
Expand Down
4 changes: 2 additions & 2 deletions tests/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def expect(
return stdout, stderr


class MockSubprocess(object):
class MockSubprocess:
def __init__(self, out="", err="", exit=0, isatty=None, autostart=True):
self.out_file = BytesIO(out.encode())
self.err_file = BytesIO(err.encode())
Expand Down Expand Up @@ -309,7 +309,7 @@ def timed_out(self):
# Runner that fakes ^C during subprocess exec
class _KeyboardInterruptingRunner(_Dummy):
def __init__(self, *args, **kwargs):
super(_KeyboardInterruptingRunner, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self._interrupted = False

# Trigger KeyboardInterrupt during wait()
Expand Down
4 changes: 2 additions & 2 deletions tests/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def prefers_task_name_attr_over_function_name(self):

def raises_ValueError_if_no_name_found(self):
# Can't use a lambda here as they are technically real functions.
class Callable(object):
class Callable:
def __call__(self, ctx):
pass

Expand Down Expand Up @@ -560,7 +560,7 @@ def transforms_are_applied_to_explicit_module_namespaces(self):
# from_module() with explicit 'ns' objects!)
namespace = self._nested_underscores()

class FakeModule(object):
class FakeModule:
__name__ = "my_module"
ns = namespace

Expand Down
2 changes: 1 addition & 1 deletion tests/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def noboomplz(c):

class MyProgram(Program):
def create_config(self):
super(MyProgram, self).create_config()
super().create_config()
self.config.tasks.ignore_unknown_help = True

MyProgram(namespace=ns).run("inv --complete -- inv noboom", exit=False)
Expand Down
2 changes: 1 addition & 1 deletion tests/concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_method(self):
class MyThread(EHThread):
def __init__(self, *args, **kwargs):
self.queue = kwargs.pop("queue")
super(MyThread, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _run(self):
self.queue.put(7)
Expand Down
4 changes: 2 additions & 2 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def numeric_types_become_casted(self):
def arbitrary_types_work_too(self):
os.environ["INVOKE_FOO"] = "whatever"

class Meh(object):
class Meh:
def __init__(self, thing=None):
pass

Expand Down Expand Up @@ -1047,7 +1047,7 @@ def raises_TypeError_if_value_is_not_Config_subclass(self):
else:
assert False, "Non-class obj did not raise TypeError!"

class Foo(object):
class Foo:
pass

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Oops(Exception):

@patch(local_path)
def cd_should_accept_any_stringable_object(self, Local):
class Path(object):
class Path:
def __init__(self, value):
self.value = value

Expand Down
2 changes: 1 addition & 1 deletion tests/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MockLoader(_BasicLoader):
def find(self, name):
# Sanity
assert name == "simple_ns_list"
return super(MockLoader, self).find(name)
return super().find(name)

config = Config({"tasks": {"collection_name": "simple_ns_list"}})
loader = MockLoader(config=config)
Expand Down
6 changes: 2 additions & 4 deletions tests/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def defaults_to_just_class_and_command(self):
def subclasses_may_add_more_kv_pairs(self):
class TotalFailure(Failure):
def _repr(self, **kwargs):
return super(TotalFailure, self)._repr(mood="dejected")
return super()._repr(mood="dejected")

expected = "<TotalFailure: cmd='onoz' mood=dejected>"
assert repr(TotalFailure(Result(command="onoz"))) == expected
Expand Down Expand Up @@ -1124,9 +1124,7 @@ def should_echo_stdin(self, input_, output):
# termios & such, which is harder to mock successfully.
if input_is_pty is not None:
input_.isatty = lambda: input_is_pty
return super(MyRunner, self).should_echo_stdin(
input_, output
)
return super().should_echo_stdin(input_, output)

# Execute basic command with given parameters
self._run(
Expand Down
2 changes: 1 addition & 1 deletion tests/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def can_be_given_extra_kwargs_to_clone_with(self):
class MyCall(Call):
def __init__(self, *args, **kwargs):
self.hooray = kwargs.pop("hooray")
super(MyCall, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

clone = orig.clone(into=MyCall, with_={"hooray": "woo"})
assert clone.hooray == "woo"
4 changes: 2 additions & 2 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def foo(c):
def is_None_if_docstring_matches_object_type(self):
# I.e. we don't want a docstring that is coming from the class
# instead of the instance.
class Foo(object):
class Foo:
"I am Foo"
pass

Expand All @@ -56,7 +56,7 @@ class Foo(object):
def instance_attached_docstring_is_still_displayed(self):
# This is actually a property of regular object semantics, but
# whatever, why not have a test for it.
class Foo(object):
class Foo:
"I am Foo"
pass

Expand Down

0 comments on commit e956312

Please sign in to comment.