Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit 0e80a13

Browse files
Workaround mypy AssertionError
mypy was failing sometimes with: ``` AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144' ``` This is due to a bug: python/mypy#7281 I have applied the workaround suggested in the above issue Full traceback ``` type run-test: commands[1] | mypy tests Traceback (most recent call last): File "/home/user/tox/.tox/type/bin/mypy", line 8, in <module> sys.exit(console_entry()) File "/home/user/tox/.tox/type/lib/python3.9/site-packages/mypy/__main__.py", line 11, in console_entry main(None, sys.stdout, sys.stderr) File "mypy/main.py", line 90, in main File "mypy/build.py", line 179, in build File "mypy/build.py", line 253, in _build File "mypy/build.py", line 2638, in dispatch File "mypy/build.py", line 2955, in process_graph File "mypy/build.py", line 3033, in process_fresh_modules File "mypy/build.py", line 1977, in fix_cross_refs File "mypy/fixup.py", line 26, in fixup_module File "mypy/fixup.py", line 77, in visit_symbol_table File "mypy/fixup.py", line 301, in lookup_qualified_stnode File "mypy/lookup.py", line 47, in lookup_fully_qualified AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144' ERROR: InvocationError for command /home/user/tox/.tox/type/bin/mypy tests (exited with code 1) ```
1 parent 651e1ae commit 0e80a13

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/util/test_pep517.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ def test_pep517_bad_message(frontend_setuptools: SubprocessFrontend, tmp_path: P
140140
assert "Backend: incorrect request to backend: bytearray(b'{{')" in err
141141

142142

143-
def test_pep517_result_missing(frontend_setuptools: SubprocessFrontend, tmp_path: Path, mocker: MockerFixture) -> None:
144-
class _Result(NamedTuple):
145-
name: str
143+
class _Result(NamedTuple):
144+
name: str
145+
146146

147+
def test_pep517_result_missing(frontend_setuptools: SubprocessFrontend, tmp_path: Path, mocker: MockerFixture) -> None:
147148
@contextmanager
148149
def named_temporary_file(prefix: str) -> Iterator[_Result]:
149150
write = S_IWUSR | S_IWGRP | S_IWOTH

0 commit comments

Comments
 (0)