Skip to content
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
Empty file removed integration_tests/__init__.py
Empty file.
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ dependencies = [
]

[tool.hatch.envs.test.scripts]
local = "source tools/use-localhost.sh; cd tests; python unit_tests.py --failfast"
prod = "source tools/use-prod.sh; cd tests; python unit_tests.py --failfast"
integration = "pytest integration_tests"
local = "source tools/use-localhost.sh; cd tests/backend; python backend_tests.py --failfast"
prod = "source tools/use-prod.sh; cd tests/backend; python backend_tests.py --failfast"
integration = "pytest tests/integration"

[tool.hatch.envs.lint]
detached = true
Expand Down Expand Up @@ -105,7 +105,6 @@ ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = [
"src/kaggle/test",
"tests",
"tests/unit",
]
pythonpath = ["src"]
Empty file removed tests/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions tests/unit_tests.py → tests/backend/backend_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from requests import HTTPError

# noinspection PyTypeChecker
sys.path.insert(0, "..")
sys.path.insert(0, "../..")

from kaggle import api
from kagglesdk.kernels.types.kernels_enums import KernelWorkerStatus
Expand All @@ -23,8 +23,8 @@
# In the case of unresolvable failure, run reset_database.sh.

# To run from Rider, create a Python tests>Unittests run config.
# Give it the module: unit_tests.TestKaggleApi
# Set the working directory to: kaggle-cli/tests
# Give it the module: backend_tests.TestKaggleApi
# Set the working directory to: kaggle-cli/tests/backend
# Define some envars:
# KAGGLE_API_ENVIRONMENT=LOCALHOST
# KAGGLE_CONFIG_DIR=/home/kaggle/.config/kaggle/dev
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ echo "Running fast unit tests with pytest..."

# Run live integration tests only if stdin is a TTY (invoked interactively)
if [ -t 0 ]; then
echo "Running live integration tests (unit_tests.py)..."
python3 -m unittest unit_tests.py
echo "Running live integration tests (backend_tests.py)..."
(cd "$SCRIPT_DIR/backend" && python3 -m unittest backend_tests.py)
fi

echo "All tests passed!"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Ensure parent directory is in path for imports
import sys

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))

from kaggle.api.kaggle_api_extended import KaggleApi
from kagglesdk.datasets.types.dataset_types import DatasetSettings, DatasetSettingsFile, DatasetSettingsFileColumn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from unittest.mock import MagicMock, patch
import sys

sys.path.insert(0, "..")
sys.path.insert(0, "../..")

from kaggle.api.kaggle_api_extended import KaggleApi, _parse_format

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import unittest
from unittest.mock import patch

sys.path.insert(0, "../src")
sys.path.insert(0, "../../src")


from kaggle.api.kaggle_api_extended import KaggleApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import tempfile
import sys

sys.path.insert(0, "..")
sys.path.insert(0, "../..")

from kaggle.api.kaggle_api_extended import KaggleApi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from unittest.mock import patch, MagicMock, mock_open

sys.path.insert(0, "../src")
sys.path.insert(0, "../../src")

from kaggle.api.kaggle_api_extended import KaggleApi

Expand Down
2 changes: 1 addition & 1 deletion tests/test_quota.py → tests/unit/test_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime, timedelta, timezone
from unittest.mock import MagicMock, patch

sys.path.insert(0, "..")
sys.path.insert(0, "../..")

from kaggle.api.kaggle_api_extended import KaggleApi

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
from unittest.mock import MagicMock, patch

sys.path.insert(0, "..")
sys.path.insert(0, "../..")

from kaggle.api.kaggle_api_extended import KaggleApi

Expand Down
Loading