Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements_minimal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ tbump~=6.11
coverage~=7.10
pytest
pytest-cov~=7.0
mypy
mypy; platform_python_implementation!="PyPy"
9 changes: 8 additions & 1 deletion tests/test_raw_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from typing import Any
from unittest import mock

import mypy.build
import pytest

import tests.testdata.python3.data.fake_module_with_broken_getattr as fm_getattr
Expand All @@ -37,6 +36,13 @@
object_build_class,
)

try:
import mypy.build

HAS_MYPY = True
except ImportError:
HAS_MYPY = False

DUMMY_MOD = build_module("DUMMY")


Expand Down Expand Up @@ -173,6 +179,7 @@ def mocked_sys_modules_getitem(name: str) -> types.ModuleType | CustomGetattr:
assert not err


@pytest.mark.skipif(not HAS_MYPY, reason="This test requires mypy")
def test_missing__dict__():
# This shouldn't raise an exception.
object_build_class(DUMMY_MOD, mypy.build.ModuleNotFound)