Skip to content

Commit

Permalink
chore: ruff PT rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 14, 2024
1 parent ea305fe commit 1e4903d
Showing 1 changed file with 49 additions and 70 deletions.
119 changes: 49 additions & 70 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@ def test_passing(self):
with self.subTest(item=item):
result = self.module.calculate(item, "key")

self.assertEqual(
result,
{
"name": self.module.name,
"result": True,
"value": None,
"reason": None,
"version": 1.0,
},
)
assert result == {
"name": self.module.name,
"result": True,
"value": None,
"reason": None,
"version": 1.0,
}

def test_failing(self):
# Ensure the child class is configured.
Expand All @@ -67,16 +64,13 @@ def test_failing(self):
with self.subTest(item=item):
result = self.module.calculate(item, "key")

self.assertEqual(
result,
{
"name": self.module.name,
"result": False,
"value": return_value,
"reason": reason,
"version": 1.0,
},
)
assert result == {
"name": self.module.name,
"result": False,
"value": return_value,
"reason": reason,
"version": 1.0,
}


class FieldQualityTests:
Expand All @@ -92,16 +86,13 @@ def test_passing(self):
with self.subTest(value=value):
result = self.method({"xxx": value}, "xxx", **self.passing_kwargs)

self.assertEqual(
result,
{
"name": self.module.name,
"result": True,
"value": None,
"reason": None,
"version": 1.0,
},
)
assert result == {
"name": self.module.name,
"result": True,
"value": None,
"reason": None,
"version": 1.0,
}

def test_failing(self):
for params in self.failing:
Expand All @@ -112,16 +103,13 @@ def test_failing(self):
with self.subTest(value=value):
result = self.method({"xxx": value}, "xxx", **self.failing_kwargs)

self.assertEqual(
result,
{
"name": self.module.name,
"result": False,
"value": return_value,
"reason": reason,
"version": 1.0,
},
)
assert result == {
"name": self.module.name,
"result": False,
"value": return_value,
"reason": reason,
"version": 1.0,
}


class CompiledReleaseTests:
Expand All @@ -140,45 +128,36 @@ def test_skipping(self):
with self.subTest(item=item):
result = self.method(item, **self.passing_kwargs)

self.assertEqual(
result,
{
"result": None,
"meta": {"reason": reason},
"application_count": None,
"pass_count": None,
"version": 1.0,
},
)
assert result == {
"result": None,
"meta": {"reason": reason},
"application_count": None,
"pass_count": None,
"version": 1.0,
}

def test_passing(self):
for item, meta, count in self.passing:
with self.subTest(item=item):
result = self.method(item, **self.passing_kwargs)

self.assertEqual(
result,
{
"result": True,
"meta": meta,
"application_count": count,
"pass_count": count,
"version": 1.0,
},
)
assert result == {
"result": True,
"meta": meta,
"application_count": count,
"pass_count": count,
"version": 1.0,
}

def test_failing(self):
for item, meta, application_count, pass_count in self.failing:
with self.subTest(item=item):
result = self.method(item, **self.failing_kwargs)

self.assertEqual(
result,
{
"result": False,
"meta": meta,
"application_count": application_count,
"pass_count": pass_count,
"version": 1.0,
},
)
assert result == {
"result": False,
"meta": meta,
"application_count": application_count,
"pass_count": pass_count,
"version": 1.0,
}

0 comments on commit 1e4903d

Please sign in to comment.