From 26ab368592be15b9f80c9e7932ef7a76af08235b Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 13 Sep 2023 11:56:49 -0400 Subject: [PATCH] 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 0fc13eb20..de1001cad 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 = ["stream.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", - )