Update pre-commit and fix existing flake8 warnings once for all

This commit is contained in:
Bastien Gérard
2020-04-25 21:36:07 +02:00
parent 1312100bc7
commit ef7da36ac6
9 changed files with 43 additions and 45 deletions

View File

@@ -216,7 +216,7 @@ class TestContextManagers:
def test_query_counter_does_not_swallow_exception(self):
with pytest.raises(TypeError):
with query_counter() as q:
with query_counter():
raise TypeError()
def test_query_counter_temporarily_modifies_profiling_level(self):
@@ -226,12 +226,12 @@ class TestContextManagers:
initial_profiling_level = db.profiling_level()
try:
NEW_LEVEL = 1
db.set_profiling_level(NEW_LEVEL)
assert db.profiling_level() == NEW_LEVEL
with query_counter() as q:
new_level = 1
db.set_profiling_level(new_level)
assert db.profiling_level() == new_level
with query_counter():
assert db.profiling_level() == 2
assert db.profiling_level() == NEW_LEVEL
assert db.profiling_level() == new_level
except Exception:
db.set_profiling_level(
initial_profiling_level