Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored main branch #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Oct 12, 2022

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from xinetzone October 12, 2022 03:04
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to GitHub API limits, only the first 60 comments can be shown.

html_short_title = "pytest-%s" % release
html_short_title = f"pytest-{release}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 196-196 refactored with the following changes:

Comment on lines 404 to +418



class WarnLogFilter(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool:
"""Ignore warnings about missing include with "only" directive.

Ref: https://github.com/sphinx-doc/sphinx/issues/2150."""
if (
record.msg.startswith('Problems with "include" directive path:')
and "_changelog_towncrier_draft.rst" in record.msg
):
return False
return True
return (
not record.msg.startswith(
'Problems with "include" directive path:'
)
or "_changelog_towncrier_draft.rst" not in record.msg
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function configure_logging refactored with the following changes:

assert 1 in [0, 2, 3, 4, 5]
assert 1 in {0, 2, 3, 4, 5}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestSpecialisedExplanations.test_in_list refactored with the following changes:

if namenotexi: # NOQA
pass
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestRaises.test_some_error refactored with the following changes:

This removes the following comments ( why? ):

# NOQA

Comment on lines -6 to +7
def setup_class(cls):
cls.classcount += 1
def setup_class(self):
self.classcount += 1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestStateFullThing.setup_class refactored with the following changes:

Comment on lines -547 to +550
tw.line("cachedir: " + str(config.cache._cachedir))
tw.line(f"cachedir: {str(config.cache._cachedir)}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function cacheshow refactored with the following changes:

Comment on lines -65 to -68
try:
with contextlib.suppress(ImportError):
import colorama # noqa: F401
except ImportError:
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _colorama_workaround refactored with the following changes:

Comment on lines -109 to +107
if not buffered and mode[0] == "w":
buffering = 0
else:
buffering = -1

buffering = 0 if not buffered and mode[0] == "w" else -1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _windowsconsoleio_workaround refactored with the following changes:

Comment on lines -267 to +261
tmpfile = CaptureIO() if not tee else TeeCaptureIO(self._old)
tmpfile = TeeCaptureIO(self._old) if tee else CaptureIO()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SysCaptureBinary.__init__ refactored with the following changes:

Comment on lines -534 to +532
if not isinstance(other, (CaptureResult, tuple)):
return NotImplemented
return tuple(self) == tuple(other)
return (
tuple(self) == tuple(other)
if isinstance(other, (CaptureResult, tuple))
else NotImplemented
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CaptureResult.__eq__ refactored with the following changes:

if not isinstance(other, (CaptureResult, tuple)):
return NotImplemented
return tuple(self) < tuple(other)
return (
tuple(self) < tuple(other)
if isinstance(other, (CaptureResult, tuple))
else NotImplemented
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CaptureResult.__lt__ refactored with the following changes:

Comment on lines -678 to +676
return "fixture %s" % self._capture_fixture.request.fixturename
return f"fixture {self._capture_fixture.request.fixturename}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CaptureManager.is_capturing refactored with the following changes:

"cannot use {} and {} at the same time".format(
requested_fixture, current_fixture
)
f"cannot use {requested_fixture} and {current_fixture} at the same time"
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CaptureManager.set_fixture refactored with the following changes:

Comment on lines -889 to +886
if self._capture is not None:
return self._capture.is_started()
return False
return self._capture.is_started() if self._capture is not None else False
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CaptureFixture._is_started refactored with the following changes:

@@ -1,4 +1,5 @@
"""Python version compatibility code."""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 23-31 refactored with the following changes:

This removes the following comments ( why? ):

# fmt: off
# fmt: on
# If `overload` is imported from `compat` instead of from `typing`,
# Sphinx doesn't recognize it as `overload` and the API docs for
# Workaround for https://github.com/sphinx-doc/sphinx/issues/10351.
# it fine.
# overloaded functions look good again. But type checkers handle

Comment on lines -409 to +404
if continue_on_failure:
# We need to turn off this if we use pdb since we should stop at
# the first failure.
if config.getvalue("usepdb"):
continue_on_failure = False
if continue_on_failure and config.getvalue("usepdb"):
continue_on_failure = False
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _get_continue_on_failure refactored with the following changes:

This removes the following comments ( why? ):

# We need to turn off this if we use pdb since we should stop at
# the first failure.

Comment on lines -752 to +743
return dict()
return {}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function doctest_namespace refactored with the following changes:

Comment on lines -120 to +125
fixture_package_name = "{}/{}".format(fixturedef.baseid, "__init__.py")
fixture_package_name = f"{fixturedef.baseid}/__init__.py"
while current and (
type(current) is not cls or fixture_package_name != current.nodeid
):
current = current.parent
if current is None:
return node.session
return current
return node.session if current is None else current
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_scope_package refactored with the following changes:

keys = dict.fromkeys(get_parametrized_fixture_keys(item, scope), None)
if keys:
if keys := dict.fromkeys(
get_parametrized_fixture_keys(item, scope), None
):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function reorder_items refactored with the following changes:

Comment on lines -322 to +328
argkeys = dict.fromkeys(
(k for k in scoped_argkeys_cache.get(item, []) if k not in ignore), None
)
if not argkeys:
no_argkey_group[item] = None
else:
if argkeys := dict.fromkeys(
(
k
for k in scoped_argkeys_cache.get(item, [])
if k not in ignore
),
None,
):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function reorder_items_atscope refactored with the following changes:

Comment on lines -475 to +478
clscol = self._pyfuncitem.getparent(_pytest.python.Class)
if clscol:
if clscol := self._pyfuncitem.getparent(_pytest.python.Class):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FixtureRequest.cls refactored with the following changes:

Comment on lines -631 to +645
fixtures_not_supported = getattr(funcitem, "nofuncargs", False)
if has_params and fixtures_not_supported:
msg = (
"{name} does not support fixtures, maybe unittest.TestCase subclass?\n"
"Node id: {nodeid}\n"
"Function type: {typename}"
).format(
name=funcitem.name,
nodeid=funcitem.nodeid,
typename=type(funcitem).__name__,
)
fail(msg, pytrace=False)
if has_params:
fixtures_not_supported = getattr(funcitem, "nofuncargs", False)
if fixtures_not_supported:
msg = (
"{name} does not support fixtures, maybe unittest.TestCase subclass?\n"
"Node id: {nodeid}\n"
"Function type: {typename}"
).format(
name=funcitem.name,
nodeid=funcitem.nodeid,
typename=type(funcitem).__name__,
)
fail(msg, pytrace=False)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FixtureRequest._compute_fixture_value refactored with the following changes:

Comment on lines -820 to +817
error_msg = "file %s, line %s: source code not available"
addline(error_msg % (fspath, lineno + 1))
addline(f"file {fspath}, line {lineno + 1}: source code not available")
else:
addline(f"file {fspath}, line {lineno + 1}")
for i, line in enumerate(lines):
for line in lines:
line = line.rstrip()
addline(" " + line)
addline(f" {line}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FixtureLookupError.formatrepr refactored with the following changes:

Comment on lines -869 to +858
lines = self.errorstring.split("\n")
if lines:
if lines := self.errorstring.split("\n"):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FixtureLookupErrorRepr.toterminal refactored with the following changes:

Comment on lines -934 to +924
"Error evaluating {} while defining fixture '{}'.\n"
"Expected a function with the signature (*, fixture_name, config)".format(
scope_callable, fixture_name
)
f"Error evaluating {scope_callable} while defining fixture '{fixture_name}'.\nExpected a function with the signature (*, fixture_name, config)"
) from e

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _eval_scope_callable refactored with the following changes:

Comment on lines -237 to +240
plugininfo = config.pluginmanager.list_plugin_distinfo()
if plugininfo:
if plugininfo := config.pluginmanager.list_plugin_distinfo():
lines.append("setuptools registered plugins:")
for plugin, dist in plugininfo:
loc = getattr(plugin, "__file__", repr(plugin))
content = f"{dist.project_name}-{dist.version} at {loc}"
lines.append(" " + content)
lines.append(f" {content}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function getpluginversioninfo refactored with the following changes:

Comment on lines -252 to +256
verinfo = getpluginversioninfo(config)
if verinfo:
if verinfo := getpluginversioninfo(config):
lines.extend(verinfo)

if config.option.traceconfig:
lines.append("active plugins:")
items = config.pluginmanager.list_name_plugin()
for name, plugin in items:
if hasattr(plugin, "__file__"):
r = plugin.__file__
else:
r = repr(plugin)
r = plugin.__file__ if hasattr(plugin, "__file__") else repr(plugin)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pytest_report_header refactored with the following changes:

if i <= 0xFF:
return "#x%02X" % i
else:
return "#x%04X" % i
return "#x%02X" % i if i <= 0xFF else "#x%04X" % i
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function bin_xml_escape refactored with the following changes:

families = {}
families["_base"] = {"testcase": ["classname", "name"]}
families["_base_legacy"] = {"testcase": ["file", "line", "url"]}
families = {
"_base": {"testcase": ["classname", "name"]},
"_base_legacy": {"testcase": ["file", "line", "url"]},
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 77-79 refactored with the following changes:

Comment on lines -105 to +103
self.properties.append((str(name), bin_xml_escape(value)))
self.properties.append((name, bin_xml_escape(value)))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _NodeReporter.add_property refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Oct 12, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.19%.

Quality metrics Before After Change
Complexity 3.83 ⭐ 3.56 ⭐ -0.27 👍
Method Length 57.23 ⭐ 57.19 ⭐ -0.04 👍
Working memory 5.34 ⭐ 5.35 ⭐ 0.01 👎
Quality 77.65% 77.84% 0.19% 👍
Other metrics Before After Change
Lines 64607 64289 -318
Changed files Quality Before Quality After Quality Change
doc/en/conf.py 59.38% 🙂 59.32% 🙂 -0.06% 👎
doc/en/example/assertion/failure_demo.py 95.56% ⭐ 95.56% ⭐ 0.00%
doc/en/example/assertion/test_setup_flow_example.py 98.28% ⭐ 98.28% ⭐ 0.00%
extra/get_issues.py 76.72% ⭐ 75.44% ⭐ -1.28% 👎
scripts/prepare-release-pr.py 61.19% 🙂 60.46% 🙂 -0.73% 👎
scripts/publish-gh-release-notes.py 68.74% 🙂 67.60% 🙂 -1.14% 👎
scripts/update-plugin-list.py 54.46% 🙂 58.24% 🙂 3.78% 👍
src/_pytest/_argcomplete.py 68.60% 🙂 68.51% 🙂 -0.09% 👎
src/_pytest/cacheprovider.py 67.05% 🙂 67.02% 🙂 -0.03% 👎
src/_pytest/capture.py 87.86% ⭐ 87.85% ⭐ -0.01% 👎
src/_pytest/compat.py 82.75% ⭐ 82.83% ⭐ 0.08% 👍
src/_pytest/debugging.py 58.68% 🙂 57.42% 🙂 -1.26% 👎
src/_pytest/doctest.py 61.66% 🙂 61.72% 🙂 0.06% 👍
src/_pytest/fixtures.py 64.18% 🙂 63.79% 🙂 -0.39% 👎
src/_pytest/freeze_support.py 71.82% 🙂 69.42% 🙂 -2.40% 👎
src/_pytest/helpconfig.py 57.94% 🙂 57.05% 🙂 -0.89% 👎
src/_pytest/junitxml.py 72.02% 🙂 72.17% 🙂 0.15% 👍
src/_pytest/legacypath.py 92.79% ⭐ 93.08% ⭐ 0.29% 👍
src/_pytest/logging.py 80.34% ⭐ 80.17% ⭐ -0.17% 👎
src/_pytest/main.py 50.21% 🙂 50.45% 🙂 0.24% 👍
src/_pytest/monkeypatch.py 74.48% 🙂 74.96% 🙂 0.48% 👍
src/_pytest/nodes.py 72.10% 🙂 72.92% 🙂 0.82% 👍
src/_pytest/outcomes.py 80.89% ⭐ 82.09% ⭐ 1.20% 👍
src/_pytest/pastebin.py 71.75% 🙂 72.40% 🙂 0.65% 👍
src/_pytest/pathlib.py 69.00% 🙂 68.84% 🙂 -0.16% 👎
src/_pytest/pytester.py 74.14% 🙂 74.10% 🙂 -0.04% 👎
src/_pytest/python.py 64.83% 🙂 65.30% 🙂 0.47% 👍
src/_pytest/python_api.py 69.01% 🙂 69.42% 🙂 0.41% 👍
src/_pytest/recwarn.py 75.58% ⭐ 77.86% ⭐ 2.28% 👍
src/_pytest/reports.py 58.89% 🙂 60.05% 🙂 1.16% 👍
src/_pytest/runner.py 72.12% 🙂 72.22% 🙂 0.10% 👍
src/_pytest/scope.py 90.05% ⭐ 89.06% ⭐ -0.99% 👎
src/_pytest/setuponly.py 69.81% 🙂 67.16% 🙂 -2.65% 👎
src/_pytest/skipping.py 60.53% 🙂 60.31% 🙂 -0.22% 👎
src/_pytest/stepwise.py 79.83% ⭐ 82.27% ⭐ 2.44% 👍
src/_pytest/terminal.py 61.05% 🙂 61.79% 🙂 0.74% 👍
src/_pytest/unittest.py 66.82% 🙂 66.49% 🙂 -0.33% 👎
src/_pytest/_code/code.py 73.47% 🙂 74.14% 🙂 0.67% 👍
src/_pytest/_code/source.py 71.08% 🙂 71.93% 🙂 0.85% 👍
src/_pytest/_io/saferepr.py 84.00% ⭐ 83.72% ⭐ -0.28% 👎
src/_pytest/_io/terminalwriter.py 74.23% 🙂 73.92% 🙂 -0.31% 👎
src/_pytest/_io/wcwidth.py 75.29% ⭐ 76.08% ⭐ 0.79% 👍
src/_pytest/assertion/init.py 73.23% 🙂 72.31% 🙂 -0.92% 👎
src/_pytest/assertion/rewrite.py 55.33% 🙂 55.32% 🙂 -0.01% 👎
src/_pytest/assertion/truncate.py 77.06% ⭐ 77.01% ⭐ -0.05% 👎
src/_pytest/assertion/util.py 55.47% 🙂 55.84% 🙂 0.37% 👍
src/_pytest/config/init.py 68.59% 🙂 68.71% 🙂 0.12% 👍
src/_pytest/config/argparsing.py 65.29% 🙂 65.59% 🙂 0.30% 👍
src/_pytest/config/findpaths.py 50.46% 🙂 51.41% 🙂 0.95% 👍
src/_pytest/mark/init.py 77.49% ⭐ 77.67% ⭐ 0.18% 👍
src/_pytest/mark/expression.py 77.14% ⭐ 77.85% ⭐ 0.71% 👍
src/_pytest/mark/structures.py 80.50% ⭐ 80.50% ⭐ 0.00%
testing/acceptance_test.py 84.69% ⭐ 84.74% ⭐ 0.05% 👍
testing/conftest.py 66.08% 🙂 67.32% 🙂 1.24% 👍
testing/deprecated_test.py 84.32% ⭐ 84.93% ⭐ 0.61% 👍
testing/test_argcomplete.py 74.13% 🙂 74.05% 🙂 -0.08% 👎
testing/test_assertion.py 88.43% ⭐ 88.50% ⭐ 0.07% 👍
testing/test_assertrewrite.py 78.06% ⭐ 78.09% ⭐ 0.03% 👍
testing/test_cacheprovider.py 82.38% ⭐ 82.38% ⭐ 0.00%
testing/test_capture.py 86.72% ⭐ 86.73% ⭐ 0.01% 👍
testing/test_collection.py 82.73% ⭐ 82.71% ⭐ -0.02% 👎
testing/test_compat.py 89.74% ⭐ 90.58% ⭐ 0.84% 👍
testing/test_config.py 80.91% ⭐ 80.91% ⭐ 0.00%
testing/test_conftest.py 79.95% ⭐ 79.91% ⭐ -0.04% 👎
testing/test_debugging.py 82.57% ⭐ 82.50% ⭐ -0.07% 👎
testing/test_doctest.py 88.19% ⭐ 88.19% ⭐ 0.00%
testing/test_faulthandler.py 88.61% ⭐ 88.58% ⭐ -0.03% 👎
testing/test_junitxml.py 80.14% ⭐ 80.13% ⭐ -0.01% 👎
testing/test_legacypath.py 89.99% ⭐ 89.72% ⭐ -0.27% 👎
testing/test_link_resolve.py 77.12% ⭐ 78.71% ⭐ 1.59% 👍
testing/test_mark.py 86.35% ⭐ 86.35% ⭐ 0.00%
testing/test_meta.py 93.71% ⭐ 93.61% ⭐ -0.10% 👎
testing/test_nodes.py 85.75% ⭐ 85.73% ⭐ -0.02% 👎
testing/test_parseopt.py 82.43% ⭐ 82.44% ⭐ 0.01% 👍
testing/test_pastebin.py 87.62% ⭐ 87.60% ⭐ -0.02% 👎
testing/test_pathlib.py 82.98% ⭐ 82.96% ⭐ -0.02% 👎
testing/test_pluginmanager.py 83.35% ⭐ 83.38% ⭐ 0.03% 👍
testing/test_pytester.py 79.29% ⭐ 79.49% ⭐ 0.20% 👍
testing/test_python_path.py 85.23% ⭐ 85.27% ⭐ 0.04% 👍
testing/test_runner.py 86.76% ⭐ 86.76% ⭐ 0.00%
testing/test_session.py 87.18% ⭐ 87.23% ⭐ 0.05% 👍
testing/test_skipping.py 90.54% ⭐ 90.54% ⭐ 0.00%
testing/test_stash.py 63.60% 🙂 63.56% 🙂 -0.04% 👎
testing/test_terminal.py 83.76% ⭐ 83.39% ⭐ -0.37% 👎
testing/test_tmpdir.py 86.03% ⭐ 86.00% ⭐ -0.03% 👎
testing/test_unittest.py 90.70% ⭐ 90.71% ⭐ 0.01% 👍
testing/test_warnings.py 83.93% ⭐ 83.81% ⭐ -0.12% 👎
testing/code/test_code.py 86.77% ⭐ 86.91% ⭐ 0.14% 👍
testing/code/test_excinfo.py 76.81% ⭐ 76.83% ⭐ 0.02% 👍
testing/code/test_source.py 90.87% ⭐ 90.94% ⭐ 0.07% 👍
testing/example_scripts/issue_519.py 90.92% ⭐ 90.87% ⭐ -0.05% 👎
testing/example_scripts/doctest/main_py/main.py 100.00% ⭐ 100.00% ⭐ 0.00%
testing/example_scripts/tmpdir/tmp_path_fixture.py 90.90% ⭐ 91.06% ⭐ 0.16% 👍
testing/freeze/tox_run.py 85.14% ⭐ 84.98% ⭐ -0.16% 👎
testing/io/test_saferepr.py 78.84% ⭐ 78.72% ⭐ -0.12% 👎
testing/logging/test_fixture.py 88.53% ⭐ 88.53% ⭐ 0.00%
testing/logging/test_formatter.py 71.26% 🙂 71.29% 🙂 0.03% 👍
testing/logging/test_reporting.py 84.62% ⭐ 84.63% ⭐ 0.01% 👍
testing/plugins_integration/simple_integration.py 97.84% ⭐ 97.92% ⭐ 0.08% 👍
testing/python/approx.py 84.63% ⭐ 84.43% ⭐ -0.20% 👎
testing/python/collect.py 87.84% ⭐ 87.84% ⭐ 0.00%
testing/python/fixtures.py 90.41% ⭐ 90.42% ⭐ 0.01% 👍
testing/python/metafunc.py 86.66% ⭐ 86.67% ⭐ 0.01% 👍
testing/python/raises.py 87.16% ⭐ 87.16% ⭐ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/_pytest/main.py Session.collect 134 ⛔ 543 ⛔ 20 ⛔ 4.46% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/_pytest/terminal.py TerminalReporter.pytest_runtest_logreport 39 ⛔ 342 ⛔ 18 ⛔ 13.73% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/_pytest/terminal.py TerminalReporter.short_test_summary 31 😞 412 ⛔ 15.23% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
src/_pytest/assertion/rewrite.py AssertionRewriter.run 41 ⛔ 304 ⛔ 13 😞 19.79% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/_pytest/doctest.py _init_checker_class 27 😞 338 ⛔ 20.15% ⛔ Refactor to reduce nesting. Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants