Skip to content

Commit

Permalink
no 3.13 yet
Browse files Browse the repository at this point in the history
  • Loading branch information
gweis committed Oct 8, 2024
1 parent 46abecd commit 443e316
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.9", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["pypy-3.9", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Include new variables for Codecov
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ coverage.xml
htmlcov
src/isodate/version.py
.eggs
.vscode/
.vscode/
10 changes: 8 additions & 2 deletions tests/test_duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,20 @@ def test_totimedelta():
assert dur.totimedelta(datetime(2001, 3, 25)) == timedelta(61)


@pytest.mark.parametrize("durationstring, expectation, format, altstr", PARSE_TEST_CASES)
@pytest.mark.parametrize(
"durationstring, expectation, format, altstr",
PARSE_TEST_CASES,
)
def test_parse(durationstring, expectation, format, altstr):
"""Parse an ISO duration string and compare it to the expected value."""
result = parse_duration(durationstring)
assert result == expectation


@pytest.mark.parametrize("durationstring, expectation, format, altstr", PARSE_TEST_CASES)
@pytest.mark.parametrize(
"durationstring, expectation, format, altstr",
PARSE_TEST_CASES,
)
def test_format_parse(durationstring, expectation, format, altstr):
"""Take duration/timedelta object and create ISO string from it.
Expand Down
8 changes: 5 additions & 3 deletions tests/test_strf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def localtime_mock(secs):
Mock time.localtime so that it always returns a time_struct with tm_dst=1
"""
tt = localtime_orig(secs)
# befor 2000 everything is dst, after 2000 no dst.
# before 2000 everything is dst, after 2000 no dst.
if tt.tm_year < 2000:
dst = 1
else:
Expand All @@ -63,8 +63,10 @@ def localtime_mock(secs):
return time.struct_time(tt)

monkeypatch.setattr(time, "localtime", localtime_mock)
monkeypatch.setattr(tzinfo, "STDOFFSET", timedelta(seconds=36000)) # assume LOC = +10:00
monkeypatch.setattr(tzinfo, "DSTOFFSET", timedelta(seconds=39600)) # assume DST = +11:00
# assume LOC = +10:00
monkeypatch.setattr(tzinfo, "STDOFFSET", timedelta(seconds=36000))
# assume DST = +11:00
monkeypatch.setattr(tzinfo, "DSTOFFSET", timedelta(seconds=39600))
monkeypatch.setattr(tzinfo, "DSTDIFF", tzinfo.DSTOFFSET - tzinfo.STDOFFSET)


Expand Down

0 comments on commit 443e316

Please sign in to comment.