From 8c44553dd2a22fc5831693ee750ff20da2349ec4 Mon Sep 17 00:00:00 2001 From: Matt Griswold Date: Fri, 18 Oct 2024 04:11:19 +0000 Subject: [PATCH] clean up --- pyproject.toml | 1 - tests/test_sync.py | 20 ++++++++++---------- uv.lock | 23 ----------------------- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5feff5d..70cc735 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,6 @@ dev-dependencies = [ "tox-uv>=1.13.0", "mypy>=0.950", "pre-commit>=2.13", - "pyupgrade>=2.19", "ruff>=0.1", "markdown", "markdown-include>=0.5,<1", diff --git a/tests/test_sync.py b/tests/test_sync.py index bc4bbfc..32d0908 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -145,8 +145,8 @@ def test_handle_initial_sync_error(client_empty, monkeypatch): """ # Delete the file if exists - if os.path.exists("failed_entries_file.json"): - os.remove("failed_entries_file.json") + if os.path.exists("failed_entries.json"): + os.remove("failed_entries.json") client = get_client() rs = all_resources() @@ -165,14 +165,14 @@ def mock_create_obj(row: dict, res): with pytest.raises(client.backend.object_missing_error()): client.get(Organization, 2) # Object with ID 2 should be missing - with open("failed_entries_file.json") as f: + with open("failed_entries.json") as f: failed_objects = json.load(f) assert len(failed_objects) == 1 assert failed_objects[0]["pk"] == 2 # Delete the file after the test - if os.path.exists("failed_entries_file.json"): - os.remove("failed_entries_file.json") + if os.path.exists("failed_entries.json"): + os.remove("failed_entries.json") def test_handle_incremental_sync_success(client_empty): @@ -194,8 +194,8 @@ def test_handle_incremental_sync_error(client_empty, monkeypatch): Test error handling in _handle_incremental_sync. """ # Delete the file if exists - if os.path.exists("failed_entries_file.json"): - os.remove("failed_entries_file.json") + if os.path.exists("failed_entries.json"): + os.remove("failed_entries.json") client = get_client() rs = all_resources() @@ -219,7 +219,7 @@ def mock_copy_object(new_obj): # Assertions assert client.get(Organization, 1) # Object with ID 1 should still exist - with open("failed_entries_file.json") as f: + with open("failed_entries.json") as f: failed_objects = json.load(f) assert len(failed_objects) >= 1 assert any( @@ -227,8 +227,8 @@ def mock_copy_object(new_obj): ) # Check if object ID 1 is present # Delete the file if exists - if os.path.exists("failed_entries_file.json"): - os.remove("failed_entries_file.json") + if os.path.exists("failed_entries.json"): + os.remove("failed_entries.json") @pytest.mark.sync diff --git a/uv.lock b/uv.lock index 06142bf..2a7472b 100644 --- a/uv.lock +++ b/uv.lock @@ -1024,7 +1024,6 @@ dev = [ { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-cov" }, - { name = "pyupgrade" }, { name = "ruff" }, { name = "tmpl" }, { name = "tox" }, @@ -1055,7 +1054,6 @@ dev = [ { name = "pre-commit", specifier = ">=2.13" }, { name = "pytest", specifier = ">=8" }, { name = "pytest-cov", specifier = ">=5" }, - { name = "pyupgrade", specifier = ">=2.19" }, { name = "ruff", specifier = ">=0.1" }, { name = "tmpl", specifier = ">=1" }, { name = "tox", specifier = ">=4" }, @@ -1193,18 +1191,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892 }, ] -[[package]] -name = "pyupgrade" -version = "3.8.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "tokenize-rt" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fc/de/b89bb5af97a3712407db232b8a43eaf8d19657cdb5740cde22650bb182d9/pyupgrade-3.8.0.tar.gz", hash = "sha256:1facb0b8407cca468dfcc1d13717e3a85aa37b9e6e7338664ad5bfe5ef50c867", size = 42768 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5e/bd/793d8a359e534ed77326858c2c7182037a2a8fd446828688b9c48c9983d4/pyupgrade-3.8.0-py2.py3-none-any.whl", hash = "sha256:08d0e6129f5e9da7e7a581bdbea689e0d49c3c93eeaf156a07ae2fd794f52660", size = 58284 }, -] - [[package]] name = "pywin32-ctypes" version = "0.2.3" @@ -1433,15 +1419,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/bb/ec/0d6261aec805eb1864e69abd79e2a61a0653d5d9b95aaf126c048b3c45ca/tmpl-1.1.0-py3-none-any.whl", hash = "sha256:0b1b8a081d8cc8e3d024c7a054dcc2fbab186d990c1e024b88e8952d86072483", size = 9177 }, ] -[[package]] -name = "tokenize-rt" -version = "6.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7d/09/6257dabdeab5097d72c5d874f29b33cd667ec411af6667922d84f85b79b5/tokenize_rt-6.0.0.tar.gz", hash = "sha256:b9711bdfc51210211137499b5e355d3de5ec88a85d2025c520cbb921b5194367", size = 5360 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5c/c2/44486862562c6902778ccf88001ad5ea3f8da5c030c638cac8be72f65b40/tokenize_rt-6.0.0-py2.py3-none-any.whl", hash = "sha256:d4ff7ded2873512938b4f8cbb98c9b07118f01d30ac585a30d7a88353ca36d22", size = 5869 }, -] - [[package]] name = "toml" version = "0.10.2"