From efd9b0a3d48e937602dbc740ed65fe233c453e88 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Mon, 18 Sep 2023 07:03:09 -0400 Subject: [PATCH 1/3] Merge pull request #1643 from asdf-format/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b77fcb47b..8f8d2950b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,13 +43,13 @@ repos: exclude: "asdf/(extern||_jsonschema)/.*" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.0.287' + rev: 'v0.0.288' hooks: - id: ruff args: ["--fix"] - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black From 2097b168e97923d497141f7568f056b8b17c2a5b Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Fri, 29 Sep 2023 06:42:40 -0400 Subject: [PATCH 2/3] Merge pull request #1650 from braingram/iobase switch IOBase to FileIO in test --- asdf/_tests/test_generic_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asdf/_tests/test_generic_io.py b/asdf/_tests/test_generic_io.py index 24860913a..31030ed73 100644 --- a/asdf/_tests/test_generic_io.py +++ b/asdf/_tests/test_generic_io.py @@ -401,7 +401,7 @@ def test_invalid_obj(tmp_path): def test_nonseekable_file(tmp_path): - base = io.IOBase + base = io.FileIO class FileWrapper(base): def tell(self): From 30b844c67988adbccb81a72f6f77c9c7932990a5 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Fri, 29 Sep 2023 07:55:14 -0400 Subject: [PATCH 3/3] Merge pull request #1645 from braingram/fix_package_tests move conftest contents to asdf/conftest --- asdf/conftest.py | 28 ++++++++++++++++++++++++++++ conftest.py | 27 --------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 conftest.py diff --git a/asdf/conftest.py b/asdf/conftest.py index e327cc1d5..97ef87ce4 100644 --- a/asdf/conftest.py +++ b/asdf/conftest.py @@ -1,4 +1,32 @@ +import os + +import pytest + # We ignore these files because these modules create deprecation warnings on # import. When warnings are turned into errors this will completely prevent # test collection collect_ignore = ["asdftypes.py", "fits_embed.py", "resolver.py", "type_index.py", "types.py", "tests/helpers.py"] + + +@pytest.fixture(scope="session", autouse=True) +def _temp_cwd(tmpdir_factory): + """ + This fixture creates a temporary current working directory + for the test session, so that docstring tests that write files + don't clutter up the real cwd. + """ + original_cwd = os.getcwd() + try: + os.chdir(tmpdir_factory.mktemp("cwd")) + yield + finally: + os.chdir(original_cwd) + + +def pytest_addoption(parser): + parser.addoption( + "--jsonschema", + action="store_true", + default=False, + help="Run jsonschema test suite tests", + ) diff --git a/conftest.py b/conftest.py deleted file mode 100644 index 342acd162..000000000 --- a/conftest.py +++ /dev/null @@ -1,27 +0,0 @@ -import os - -import pytest - - -@pytest.fixture(scope="session", autouse=True) -def _temp_cwd(tmpdir_factory): - """ - This fixture creates a temporary current working directory - for the test session, so that docstring tests that write files - don't clutter up the real cwd. - """ - original_cwd = os.getcwd() - try: - os.chdir(tmpdir_factory.mktemp("cwd")) - yield - finally: - os.chdir(original_cwd) - - -def pytest_addoption(parser): - parser.addoption( - "--jsonschema", - action="store_true", - default=False, - help="Run jsonschema test suite tests", - )