mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-18 06:16:29 +00:00
[Stats] Fix creating test artifacts in tmp not pwd
This commit is contained in:
parent
f3d7b1ffe8
commit
5aa4d07816
@ -9,9 +9,11 @@
|
|||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
# the additional special exception to link portions of this program with the OpenSSL library.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
# See LICENSE for more details.
|
# See LICENSE for more details.
|
||||||
#
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import gi # isort:skip (Required before Gtk import).
|
||||||
|
|
||||||
|
gi.require_version('Gtk', '3.0')
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository.Gdk import RGBA
|
from gi.repository.Gdk import RGBA
|
||||||
|
@ -58,7 +58,7 @@ class TestStatsPlugin:
|
|||||||
|
|
||||||
@pytest.mark.gtkui
|
@pytest.mark.gtkui
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def test_write(self):
|
def test_write(self, tmp_path):
|
||||||
"""
|
"""
|
||||||
writing to a file-like object; need this for webui.
|
writing to a file-like object; need this for webui.
|
||||||
|
|
||||||
@ -102,5 +102,5 @@ class TestStatsPlugin:
|
|||||||
file_like = FakeFile()
|
file_like = FakeFile()
|
||||||
surface.write_to_png(file_like)
|
surface.write_to_png(file_like)
|
||||||
data = b''.join(file_like.data)
|
data = b''.join(file_like.data)
|
||||||
with open('file_like.png', 'wb') as _file:
|
with open(tmp_path / 'file_like.png', 'wb') as _file:
|
||||||
_file.write(data)
|
_file.write(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user