Skip to content
Open
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
18 changes: 11 additions & 7 deletions mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from collections.abc import Iterator
from typing import Any

import pytest

from mypy import build
from mypy.errors import CompileError
from mypy.options import Options
Expand Down Expand Up @@ -162,13 +164,15 @@ class TestRun(MypycDataSuite):
strict_dunder_typing = False

def run_case(self, testcase: DataDrivenTestCase) -> None:
# setup.py wants to be run from the root directory of the package, which we accommodate
# by chdiring into tmp/
with (
use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase),
chdir_manager("tmp"),
):
self.run_case_inner(testcase)
with pytest.MonkeyPatch.context() as mp:
mp.delenv("CFLAGS", raising=False)
# setup.py wants to be run from the root directory of the package, which we accommodate
# by chdiring into tmp/
with (
use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase),
chdir_manager("tmp"),
):
self.run_case_inner(testcase)

def run_case_inner(self, testcase: DataDrivenTestCase) -> None:
if not os.path.isdir(WORKDIR): # (one test puts something in build...)
Expand Down
Loading