Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: This and that #90

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ authors = [
{ name = "Marija Selakovic", email = "[email protected]" },
{ name = "Andreas Motl", email = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
Expand All @@ -46,6 +46,7 @@ classifiers = [
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down Expand Up @@ -85,7 +86,7 @@ dynamic = [
dependencies = [
"boltons<24",
"click<9",
"click-aliases<2,>=1.0.3",
"click-aliases<2,>=1.0.4",
"colorama<1",
"colorlog",
"crash",
Expand All @@ -101,7 +102,7 @@ all = [
"cratedb-toolkit[influxdb,io,mongodb]",
]
develop = [
"black<24",
"black[jupyter]<24",
"mypy==1.6.1",
"poethepoet<0.25",
"pyproject-fmt<1.4",
Expand All @@ -128,7 +129,7 @@ release = [
"twine<5",
]
test = [
"pueblo[dataframe]@ git+https://github.com/pyveci/pueblo.git@develop",
"pueblo[dataframe]",
"pytest<8",
"pytest-cov<5",
"pytest-mock<4",
Expand Down
18 changes: 17 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (c) 2021-2023, Crate.io Inc.
# Distributed under the terms of the AGPLv3 license, see LICENSE.
import os

import pytest
import responses

Expand Down Expand Up @@ -28,7 +30,21 @@


@pytest.fixture(scope="session", autouse=True)
def configure_database_schema(session_mocker):
def prune_environment():
"""
Delete all environment variables starting with `CRATEDB_` or `CRATE_`,
to prevent leaking from the developer's environment to the test suite.
"""
delete_items = []
for envvar in os.environ.keys():
if envvar.startswith("CRATEDB_") or envvar.startswith("CRATE_"):
delete_items.append(envvar)
for envvar in delete_items:
del os.environ[envvar]


@pytest.fixture(scope="session", autouse=True)
def configure_database_schema(session_mocker, prune_environment):
"""
Configure the machinery to use a different schema for storing subsystem database
tables, so that they do not accidentally touch the production system.
Expand Down