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
13 changes: 13 additions & 0 deletions mypy/test/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,19 @@ def runtest(self) -> None:
# TODO: add a better error message for when someone uses skip and xfail at the same time
elif self.xfail:
self.add_marker(pytest.mark.xfail)

if (
not [line for line in self.input if line.strip()]
and "Empty" not in self.name
and not [
file
for file in self.files
# these files are added based on other things
if os.path.basename(file[0]) not in ("typing.pyi", "_typeshed.pyi", "builtins.pyi")
]
):
raise AssertionError(f"{self.name} is empty.")

parent = self.getparent(DataSuiteCollector)
assert parent is not None, "Should not happen"
suite = parent.obj()
Expand Down