Skip to content

Commit

Permalink
Python 3.8 syntax fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RishiDiwanTT committed Jul 28, 2023
1 parent 4b0cfcd commit edf3756
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/core/jobs/test_playtime_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,14 @@ def test_do_run(self, db: DatabaseTransactionFixture):
playtime(db.session, identifier2, date3m(3), 5)
playtime(db.session, identifier2, date3m(4), 6)

with (
patch("core.jobs.playtime_entries.csv.writer") as writer,
patch("core.jobs.playtime_entries.EmailManager") as email,
patch(
"core.jobs.playtime_entries.os.environ",
new={
Configuration.REPORTING_EMAIL_ENVIRONMENT_VARIABLE: "reporting@test.email"
},
),
# Horrible unbracketted syntax for python 3.8
with patch("core.jobs.playtime_entries.csv.writer") as writer, patch(
"core.jobs.playtime_entries.EmailManager"
) as email, patch(
"core.jobs.playtime_entries.os.environ",
new={
Configuration.REPORTING_EMAIL_ENVIRONMENT_VARIABLE: "reporting@test.email"
},
):
PlaytimeEntriesEmailReportsScript(db.session).run()

Expand Down

0 comments on commit edf3756

Please sign in to comment.