I don't think it is possible to ignore a specific line without changing the source code. However, it is certainly possible to ignore warning types in the .pylintrc
or at the top of file.
I'd go with the approach of creating a .pylintrc to suit your needs. For example, if you want to completely ignore W0612: unused-variable
then you can create a .pylintrc file and add message names to disable as noted in pytest docs.
.pylintrc
disable=unused-variable,
...,
Alternatively, you can disable messages on a case by case basis at the top of the file, and just tell your students to ignore it:
Top of file
# pylint: disable=unused-variable, wildcard-import, method-hidden
# pylint: enable=too-many-lines