Skip to content

Commit c6ea0de

Browse files
committed
Use yapf for code formatting
1 parent d5604d6 commit c6ea0de

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

domdf_python_tools/dates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,6 @@ def check_date(month, day, leap_year=True):
245245

246246
except ImportError:
247247
import warnings
248-
warnings.warn("'domdf_python_tools.dates' requires pytz (https://pypi.org/project/pytz/), but it is not installed.")
248+
warnings.warn(
249+
"'domdf_python_tools.dates' requires pytz (https://pypi.org/project/pytz/), but it is not installed."
250+
)

domdf_python_tools/paths.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ def relpath(path, relative_to=None):
155155

156156
# if os.path.normpath(os.path.abspath(path)).startswith(
157157
# os.path.normpath(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))):
158-
if os.path.normpath(os.path.abspath(path)
159-
).startswith(os.path.normpath(os.path.dirname(os.path.dirname(os.path.abspath(relative_to))))):
158+
if os.path.normpath(os.path.abspath(path)).startswith(
159+
os.path.normpath(os.path.dirname(os.path.dirname(os.path.abspath(relative_to))))
160+
):
160161
return os.path.relpath(os.path.abspath(path))
161162
else:
162163
return os.path.abspath(path)

tests/test_dates.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ def test_set_timezone():
8383

8484
# Difference between "today" and the new timezone should be the timezone difference
8585
assert (
86-
dates.set_timezone(today, dates.get_timezone(tz, today)).timestamp() +
87-
dates.get_utc_offset(tz, today).total_seconds()
86+
dates.set_timezone(today, dates.get_timezone(tz, today)).timestamp()
87+
+ dates.get_utc_offset(tz, today).total_seconds()
8888
) == today.timestamp()
8989

9090
if tz in {
@@ -112,8 +112,8 @@ def test_set_timezone():
112112
#
113113
# )
114114
assert (
115-
dates.set_timezone(test_date, dates.get_timezone(tz, test_date)).timestamp() +
116-
dates.get_utc_offset(tz, test_date).total_seconds()
115+
dates.set_timezone(test_date, dates.get_timezone(tz, test_date)).timestamp()
116+
+ dates.get_utc_offset(tz, test_date).total_seconds()
117117
) == test_date.timestamp()
118118

119119

0 commit comments

Comments
 (0)