Python 3.11

This commit is contained in:
f4lco
2022-11-01 22:26:41 +01:00
parent 3dabf375c9
commit c308118e8f
12 changed files with 413 additions and 486 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ def api_online_one_shot():
path = os.path.join(os.path.dirname(__file__),
'resources', 'input.json')
with open(path) as api_response:
with open(path, encoding='utf-8') as api_response:
return 200, response_headers, api_response.read()
responses = [
+2 -2
View File
@@ -17,7 +17,7 @@ def _canteen():
def _read_menu(resource_name):
with open(_resource_path(resource_name)) as menu_file:
with open(_resource_path(resource_name), encoding='utf-8') as menu_file:
return json.load(menu_file)
@@ -28,7 +28,7 @@ def _read_feed(resource_name):
def test_meta_consistency():
canteen = _canteen()
menu_feed_url = "canteens/{}/menu".format(canteen.key)
menu_feed_url = f"canteens/{canteen.key}/menu"
actual = feed.render_meta(canteen, menu_feed_url)
+3 -3
View File
@@ -32,14 +32,14 @@ def is_enabled():
requires_online_api = pytest.mark.skipif(
not is_enabled(),
reason='Querying the online API is disabled. '
'Turn on by setting env variable %s.' % ENV_ENABLED
reason="Querying the online API is disabled. "
f"Turn on by setting env variable {ENV_ENABLED}."
)
@requires_online_api
def test_retrieval(canteen):
feed.render_meta(canteen, "/canteens/{}/menu".format(canteen.key))
feed.render_meta(canteen, f"/canteens/{canteen.key}/menu")
params = MenuParams(canteen_id=canteen.id, chash=canteen.chash)
try:
+1 -1
View File
@@ -65,7 +65,7 @@ def _request_check_meals(client):
assert response.status_code == 200
meal = meal_names(response.data)[0]
assert meal == u"Gefüllter Germknödel \nmit Vanillesauce und Mohnzucker"
assert meal == "Gefüllter Germknödel \nmit Vanillesauce und Mohnzucker"
@pytest.fixture