Mousius commented on code in PR #11666:
URL: https://github.com/apache/tvm/pull/11666#discussion_r899940315
##########
tests/python/ci/test_mergebot.py:
##########
@@ -165,7 +158,8 @@ def test_mergebot(tmpdir_factory, number, filename,
expected, comment, user, det
}
collaborators = []
- proc = subprocess.run(
+ # return code is checked manually, so disable pylint
+ proc = subprocess.run( # pylint: disable=subprocess-run-check
Review Comment:
We can use `check=False` here as well I think? I ran the tests and linter
locally to check everything still works.
##########
tests/python/ci/test_utils.py:
##########
@@ -14,7 +14,29 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
+"""
+Constants used in various CI tests
+"""
+import subprocess
import pathlib
REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent.parent.parent
+
+
+class TempGit:
+ """
+ A wrapper to run commands in a directory
+ """
+
+ def __init__(self, cwd):
+ self.cwd = cwd
+
+ def run(self, *args, **kwargs):
+ # the returncode is checked manually, ignore pylint
+ proc = subprocess.run( # pylint: disable=subprocess-run-check
+ ["git"] + list(args), encoding="utf-8", cwd=self.cwd, **kwargs
+ )
Review Comment:
```suggestion
def run(self, *args, **kwargs):
"""Runs a git command in the temporary directory"""
proc = subprocess.run(
["git"] + list(args),
encoding="utf-8",
check=False,
cwd=self.cwd,
**kwargs,
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]