Skip to content

Commit dd50155

Browse files
authored
tests: try to make tests pass on Python 3.13 on unix platforms (#10665)
1 parent 54acfda commit dd50155

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

.github/workflows/benchmarks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.12"
19+
python-version: "3.13"
2020

2121
- uses: actions/checkout@v4
2222
with:

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.12
28+
python-version: 3.13
2929

3030
- uses: astral-sh/setup-uv@v5
3131
- run: uv pip install --upgrade setuptools_scm twine --system

.github/workflows/plugin_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ubuntu-latest]
22-
pyv: ["3.12"]
22+
pyv: ["3.13"]
2323
plugin: ["dvc-s3"]
2424

2525
steps:

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Python
3333
uses: actions/setup-python@v5
3434
with:
35-
python-version: '3.12'
35+
python-version: '3.13'
3636
- uses: astral-sh/setup-uv@v5
3737
with:
3838
enable-cache: true
@@ -55,7 +55,7 @@ jobs:
5555
fail-fast: false
5656
matrix:
5757
os: [ubuntu-latest, macos-latest]
58-
pyv: ["3.9", "3.10", "3.11", "3.12"]
58+
pyv: ["3.9", "3.10", "3.11", "3.12", "3.13"]
5959
include:
6060
- os: windows-latest
6161
pyv: "3.9"

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ classifiers = [
2727
"Programming Language :: Python :: 3.10",
2828
"Programming Language :: Python :: 3.11",
2929
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
3031
]
3132
dynamic = ["version"]
3233

@@ -172,6 +173,8 @@ filterwarnings = [
172173
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
173174
# see https://github.com/networkx/networkx/issues/5723.
174175
"ignore:nx.nx_pydot.* depends on the pydot package, which has.*known issues and is not actively maintained:DeprecationWarning",
176+
# TODO: investigate where we are not closing sqlite3.Connection
177+
"ignore:unclosed database.*sqlite3.Connection:ResourceWarning",
175178
]
176179
log_level = "debug"
177180
markers = [

tests/unit/test_logger.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import logging
2-
import time
32
import traceback
4-
from datetime import datetime
53

64
import colorama
75
import pytest
@@ -22,11 +20,9 @@
2220

2321
@pytest.fixture
2422
def dt(mocker):
25-
mocker.patch(
26-
"time.time",
27-
return_value=time.mktime(datetime(2020, 2, 2).timetuple()), # noqa: DTZ001
28-
)
29-
return "2020-02-02 00:00:00,000"
23+
dt_str = "2020-02-02 00:00:00,000"
24+
mocker.patch.object(formatter, "formatTime", return_value=dt_str)
25+
return dt_str
3026

3127

3228
class TestColorFormatter:

tests/unit/ui/test_pager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from pydoc import plainpager
2+
13
import pytest
24

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

7274

73-
def test_make_pager_when_no_pager_found(mocker, monkeypatch):
74-
assert make_pager(None).__name__ == "plainpager"
75+
def test_make_pager_when_no_pager_found():
76+
assert make_pager(None) is plainpager
7577

7678

7779
def test_pager(mocker, monkeypatch):

0 commit comments

Comments
 (0)