Skip to content

Commit

Permalink
tests: try to make tests pass on Python 3.13 on unix platforms (#10665)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Jan 9, 2025
1 parent 54acfda commit dd50155
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13

- uses: astral-sh/setup-uv@v5
- run: uv pip install --upgrade setuptools_scm twine --system
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plugin_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
pyv: ["3.12"]
pyv: ["3.13"]
plugin: ["dvc-s3"]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
Expand All @@ -55,7 +55,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
pyv: ["3.9", "3.10", "3.11", "3.12"]
pyv: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: windows-latest
pyv: "3.9"
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = ["version"]

Expand Down Expand Up @@ -172,6 +173,8 @@ filterwarnings = [
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
# see https://github.com/networkx/networkx/issues/5723.
"ignore:nx.nx_pydot.* depends on the pydot package, which has.*known issues and is not actively maintained:DeprecationWarning",
# TODO: investigate where we are not closing sqlite3.Connection
"ignore:unclosed database.*sqlite3.Connection:ResourceWarning",
]
log_level = "debug"
markers = [
Expand Down
10 changes: 3 additions & 7 deletions tests/unit/test_logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import logging
import time
import traceback
from datetime import datetime

import colorama
import pytest
Expand All @@ -22,11 +20,9 @@

@pytest.fixture
def dt(mocker):
mocker.patch(
"time.time",
return_value=time.mktime(datetime(2020, 2, 2).timetuple()), # noqa: DTZ001
)
return "2020-02-02 00:00:00,000"
dt_str = "2020-02-02 00:00:00,000"
mocker.patch.object(formatter, "formatTime", return_value=dt_str)
return dt_str


class TestColorFormatter:
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/ui/test_pager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pydoc import plainpager

import pytest

from dvc.env import DVC_PAGER
Expand Down Expand Up @@ -70,8 +72,8 @@ def test_dvc_sets_some_options_on_less_if_less_env_defined(mocker, monkeypatch,
assert find_pager() == "less --RAW-CONTROL-CHARS --chop-long-lines"


def test_make_pager_when_no_pager_found(mocker, monkeypatch):
assert make_pager(None).__name__ == "plainpager"
def test_make_pager_when_no_pager_found():
assert make_pager(None) is plainpager


def test_pager(mocker, monkeypatch):
Expand Down

0 comments on commit dd50155

Please sign in to comment.