Skip to content

Commit 54ab6ff

Browse files
committed
Unit tests - fix webp_encoding_test
1 parent 73b4904 commit 54ab6ff

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

test/python_tests/webp_encoding_test.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
import os
33
import pytest
44

5+
from .utilities import execution_path
6+
7+
@pytest.fixture(scope="module")
8+
def setup():
9+
# All of the paths used are relative, if we run the tests
10+
# from another directory we need to chdir()
11+
os.chdir(execution_path('.'))
12+
yield
13+
514
if mapnik.has_webp():
615
tmp_dir = '/tmp/mapnik-webp/'
716
if not os.path.exists(tmp_dir):
@@ -31,10 +40,10 @@
3140
]
3241

3342
def gen_filepath(name, format):
34-
return os.path.join('./test/python_tests/images/support/encoding-opts',
43+
return os.path.join('images/support/encoding-opts',
3544
name + '-' + format.replace(":", "+") + '.webp')
3645

37-
def test_quality_threshold():
46+
def test_quality_threshold(setup):
3847
im = mapnik.Image(256, 256)
3948
im.tostring('webp:quality=99.99000')
4049
im.tostring('webp:quality=0')

0 commit comments

Comments
 (0)