diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py index 899fea6b613..03e38e85e86 100644 --- a/sphinx/testing/fixtures.py +++ b/sphinx/testing/fixtures.py @@ -239,7 +239,7 @@ def if_graphviz_found(app: SphinxTestApp) -> None: # NoQA: PT004 @pytest.fixture(scope='session') -def sphinx_test_tempdir(tmp_path_factory: Any) -> Path: +def sphinx_test_tempdir(tmp_path_factory: pytest.TempPathFactory) -> Path: """Temporary directory.""" return tmp_path_factory.getbasetemp() diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index 3a9ee8ddb20..49f0ffa6005 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -178,7 +178,7 @@ def read_bytes(self) -> builtins.bytes: with open(self, mode='rb') as f: return f.read() - def write_bytes(self, bytes: str, append: bool = False) -> None: + def write_bytes(self, bytes: bytes, append: bool = False) -> None: """ Writes the given `bytes` to the file. diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py index 32912e014d7..f17ef71294b 100644 --- a/sphinx/util/parallel.py +++ b/sphinx/util/parallel.py @@ -23,7 +23,7 @@ logger = logging.getLogger(__name__) # our parallel functionality only works for the forking Process -parallel_available = multiprocessing and os.name == 'posix' +parallel_available = HAS_MULTIPROCESSING and os.name == 'posix' class SerialTasks: