Skip to content

Commit

Permalink
Rename _is_master to _is_xdist_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtucker committed Feb 16, 2024
1 parent 1a75f22 commit 9d0b3b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pytest_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def _get_xdist_workerinput(config_node):
return workerinput


def _is_master(config):
def _is_xdist_controller(config):
"""
True if the code running the given pytest.config object is running in
an xdist master node or not running xdist at all.
an xdist controller node or not running xdist at all.
"""
return _get_xdist_workerinput(config) is None

Expand All @@ -73,7 +73,7 @@ def pytest_configure(config):
register a custom marker for MypyItems,
and configure the plugin based on the CLI.
"""
if _is_master(config):
if _is_xdist_controller(config):

# Get the path to a temporary file and delete it.
# The first MypyItem to run will see the file does not exist,
Expand Down Expand Up @@ -294,7 +294,7 @@ def from_session(cls, session) -> "MypyResults":
"""Load (or generate) cached mypy results for a pytest session."""
results_path = (
session.config._mypy_results_path
if _is_master(session.config)
if _is_xdist_controller(session.config)
else _get_xdist_workerinput(session.config)["_mypy_results_path"]
)
with FileLock(results_path + ".lock"):
Expand Down Expand Up @@ -323,7 +323,7 @@ class MypyWarning(pytest.PytestWarning):

def pytest_terminal_summary(terminalreporter, config):
"""Report stderr and unrecognized lines from stdout."""
if not _is_master(config):
if not _is_xdist_controller(config):
# This isn't hit in pytest 5.0 for some reason.
return # pragma: no cover
try:
Expand Down

0 comments on commit 9d0b3b4

Please sign in to comment.