Skip to content

Commit 89cbb86

Browse files
committed
disallow tests in init files
1 parent ef39029 commit 89cbb86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/robot/running/builder/builders.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ def _build_suite(self, structure):
110110
self._validate_execution_mode(suite)
111111
except DataError as err:
112112
raise DataError("Parsing '%s' failed: %s" % (source, err.message))
113+
if structure.is_directory and suite.tests:
114+
LOGGER.error("Test suite initialization file in '%s' cannot "
115+
"contain tests or tasks." % source)
116+
suite.tests.clear()
113117
return suite, defaults
114118

115119
def _validate_execution_mode(self, suite):

0 commit comments

Comments
 (0)