Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#563)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 7, 2023
1 parent 80da7e6 commit f3568b6
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
language_version: python3
Expand Down
1 change: 0 additions & 1 deletion nose2/plugins/loader/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def __repr__(self):

def GeneratorMethodCase(cls):
class _GeneratorMethodCase(GeneratorFunctionCase):

if util.has_class_fixtures(cls):

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion nose2/plugins/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _runmp(self, test, result):
# replay events
testid, events = remote_events
log.debug("Received results for %s", testid)
for (hook, event) in events:
for hook, event in events:
log.debug("Received %s(%s)", hook, event)
self._localize(event)
getattr(self.session.hooks, hook)(event)
Expand Down
2 changes: 1 addition & 1 deletion nose2/plugins/prettyassert.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _tokenize_assert(source_lines, frame_locals, frame_globals):
assert_startline -= 1

token_descriptions = collections.OrderedDict()
for (name, obj) in token_processor.get_token_collection().items():
for name, obj in token_processor.get_token_collection().items():
# okay, get repr() for a good string representation
strvalue = repr(obj)
# add in the form we want to print
Expand Down
1 change: 1 addition & 0 deletions nose2/plugins/prof.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def startTestRun(self, event):

def beforeSummaryReport(self, event):
"""Output profiling results"""

# write prof output to stream
class Stream:
def write(self, *msg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,20 @@ def tearDown(cls):


class LayerTest1(unittest.TestCase):

layer = Layer1

def test(self):
self.assertTrue(self.layer.unique_resource.used)


class LayerTest2(unittest.TestCase):

layer = Layer2

def test(self):
self.assertTrue(self.layer.unique_resource.used)


class LayerTest3(unittest.TestCase):

layer = Layer2

def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Layer1:

description = "Layer1"

@classmethod
Expand All @@ -24,7 +23,6 @@ def tearDown(cls):


class Layer2:

description = "Layer2"

@classmethod
Expand All @@ -37,15 +35,13 @@ def tearDown(cls):


with such.A("system with setup") as it:

it.uses(Layer1)

@it.should("do something")
def test(case):
it.assertTrue(it.unique_resource.used)

with it.having("another setup"):

it.uses(Layer2)

@it.should("do something else") # noqa: F811
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class Layer1:

layer_setup = 0
test_setup = 0
test_teardown = 0
Expand Down Expand Up @@ -35,7 +34,6 @@ def tearDown(cls):


class TestSimple(unittest.TestCase):

layer = Layer1

def test_1(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from nose2.tools import such

with such.A("system") as it:

with it.having("something"):

@it.should("do stuff")
Expand All @@ -13,7 +12,6 @@ def test_should_do_stuff(case):
it.createTests(globals())

with such.A("another system") as it:

with it.having("something"):

@it.should("do stuff") # noqa: F811
Expand Down
2 changes: 0 additions & 2 deletions nose2/tests/functional/support/such/test_such.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def tearDown(cls):
# a name that makes nice sentences, like 'this' or 'it'.
#
with such.A("system with complex setup") as it:

#
# Each layer of tests can define setup and teardown methods.
# setup and teardown methods defined here run around the entire
Expand Down Expand Up @@ -96,7 +95,6 @@ def test(case): # noqa: F811
# A layer may have any number of sub-layers.
#
with it.having("a different precondition"):

#
# A layer defined with ``having`` can make use of
# layers defined elsewhere. An external layer
Expand Down
4 changes: 0 additions & 4 deletions nose2/tests/functional/support/such/test_such_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def slow_blocking_init():


class Layer1:

description = "Layer1 description"

@classmethod
Expand All @@ -23,7 +22,6 @@ def setUp(cls):


class Layer2:

description = "Layer2 description"

@classmethod
Expand All @@ -32,15 +30,13 @@ def setUp(cls):


with such.A("system with a fast initial setup layer") as it:

it.uses(Layer1)

@it.should("not have obj initialized")
def test():
assert not it.obj

with it.having("a second slow setup layer"):

it.uses(Layer2)

@it.should("have obj initialized")
Expand Down
1 change: 0 additions & 1 deletion nose2/tests/unit/test_buffer_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def setUp(self):
self.plugin.register()

class Test(TestCase):

printed_nonascii_str = util.safe_decode("test 日本").encode("utf-8")
printed_unicode = "hello"

Expand Down
1 change: 0 additions & 1 deletion nose2/tests/unit/test_layers_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ def test(self):
self.assertEqual(self.names(event.suite), expect)

def test_invalid_top_layer(self):

# in python 3, L1 will automatically have `object` has base, so
# this test does not make sense, and will actually fail.
return
Expand Down
1 change: 0 additions & 1 deletion nose2/tests/unit/test_printhooks_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class CustomEvent(events.Event):

_attrs = events.Event._attrs + ("args",)

def __init__(self, args, **kw):
Expand Down

0 comments on commit f3568b6

Please sign in to comment.