Skip to content

Commit

Permalink
Apply ruff suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnouki committed Nov 14, 2024
1 parent 6ea9e45 commit 56861b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions timezones/test_timezones.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os.path

import pytest

from . import _defs, tz_rendering, tz_utils, zones
Expand Down Expand Up @@ -63,7 +61,7 @@ def test_valid_offset(offset_str, tzname, verbose_name):
assert offset_str == expected_offset, f"Invalid offset for {tzname}"

# 3. Test verbose name
assert verbose_name.startswith("(GMT%s) " % expected_offset)
assert verbose_name.startswith(f"(GMT{expected_offset}) ")


def test_get_timezones_json():
Expand Down
4 changes: 2 additions & 2 deletions timezones/tz_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def render_option_disabled():
if select_id:
select_elm = f'<select name="{select_name}" id="{select_id}">'
else:
select_elm = '<select name="%s">' % select_name
select_elm = f'<select name="{select_name}">'

result = [select_elm]

if first_entry:
result.append('<option value="">%s</option>' % first_entry)
result.append(f'<option value="">{first_entry}</option>')
result.append(render_option_disabled())

if force_current_selected and current_selected:
Expand Down

0 comments on commit 56861b6

Please sign in to comment.