From 0465c7968d6687fb40ee4793e8069fa6173314ae Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 11 Jan 2024 12:06:39 -0300 Subject: [PATCH] Run pyupgrade --py38-plus --- .github/workflows/deploy.yml | 2 -- src/pytest_replay/__init__.py | 2 +- tests/test_replay.py | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 420a784..ddc949f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,14 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Download Package uses: actions/download-artifact@v3 with: name: Packages path: dist - - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@v1.8.11 with: diff --git a/src/pytest_replay/__init__.py b/src/pytest_replay/__init__.py index cf6c371..93e4638 100644 --- a/src/pytest_replay/__init__.py +++ b/src/pytest_replay/__init__.py @@ -104,7 +104,7 @@ def pytest_collection_modifyitems(self, items, config): if not replay_file: return - with open(replay_file, "r", encoding="UTF-8") as f: + with open(replay_file, encoding="UTF-8") as f: all_lines = f.readlines() # Use a dict to deduplicate the node ids while keeping the order. nodeids = dict.fromkeys( diff --git a/tests/test_replay.py b/tests/test_replay.py index cebc6d2..6bb18b2 100644 --- a/tests/test_replay.py +++ b/tests/test_replay.py @@ -160,7 +160,7 @@ def test_alternate_serial_parallel_does_not_erase_runs(suite, testdir, reverse): for command_line in command_lines: result = testdir.runpytest_subprocess(*command_line) assert result.ret == 0 - assert set(x.basename for x in (testdir.tmpdir / "replay").listdir()) == { + assert {x.basename for x in (testdir.tmpdir / "replay").listdir()} == { ".pytest-replay.txt", ".pytest-replay-gw0.txt", ".pytest-replay-gw1.txt", @@ -186,7 +186,7 @@ def test_skip_cleanup_does_not_erase_replay_files(suite, testdir): for command_line in command_lines: result = testdir.runpytest_subprocess(*command_line) assert result.ret == 0 - assert set(x.basename for x in dir.listdir()) == { + assert {x.basename for x in dir.listdir()} == { ".pytest-replay-gw0.txt", ".pytest-replay-gw1.txt", }