Skip to content

Commit

Permalink
refactor(conftest): don't make clients session scoped
Browse files Browse the repository at this point in the history
patching them will overwrite attributes
  • Loading branch information
SlowMo24 committed Feb 19, 2024
1 parent 81e9011 commit cdb88e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ohsome/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
logger = logging.getLogger(__name__)


@pytest.fixture(scope="session")
def base_client(tmpdir_factory):
@pytest.fixture
def base_client(mocked_metadata, tmpdir_factory):
"""Session-wide test client."""
temp_directory = tmpdir_factory.mktemp("base_client").mkdir("logs").strpath
client = ohsome.OhsomeClient(log_dir=temp_directory)
assert client.metadata # call metadata once to ensure it is cached
yield client


@pytest.fixture(scope="session")
def base_client_without_log():
@pytest.fixture
def base_client_without_log(mocked_metadata):
"""Session-wide test client."""
client = ohsome.OhsomeClient(log=False)
assert client.metadata # call metadata once to ensure it is cached
yield client


@pytest.fixture(scope="session")
@pytest.fixture
def custom_client_with_wrong_url(tmpdir_factory):
"""Session-wide test client."""
temp_directory = tmpdir_factory.mktemp("base_client").mkdir("logs").strpath
Expand Down

0 comments on commit cdb88e1

Please sign in to comment.