From 3d65835dccd30e6c7bc1cf906b336b55ceaf87be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Fri, 24 Nov 2023 20:35:50 +0000 Subject: [PATCH] Run ruff in CI --- .github/workflows/main.yml | 6 +++++- python/subunit/__init__.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9248e22..59ae714 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,9 +21,13 @@ jobs: - name: Install Deps run: sudo apt-get install check libcppunit-dev - name: Install package - run: python -m pip install -U '.[test,docs]' + run: | + python -m pip install ruff + python -m pip install -U '.[test,docs]' - name: Build run: autoreconf -fi && ./configure && make + - name: Run ruff check + run: ruff check python - name: Run make check run: make check - name: Run make distcheck diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 5328ce5..3af90b0 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -762,7 +762,7 @@ def addUnexpectedSuccess(self, test, details=None): def _test_id(self, test): result = test.id() - if type(result) is not bytes: + if not isinstance(result, bytes): result = result.encode('utf8') return result