Skip to content

Commit

Permalink
Adapt webasset TempEnvironmentHelper to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Feb 15, 2024
1 parent 8735ba2 commit e1683f3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_webassets_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
from StringIO import StringIO


class TestAssetsFilters(TempEnvironmentHelper):
class PyTestTempEnvironmentHelper(TempEnvironmentHelper):
"""Adapt TempEnvironmentHelper to be compatible with PyTest"""
def setup_method(self):
self.setup()

def teardown_method(self):
self.teardown()


class TestAssetsFilters(PyTestTempEnvironmentHelper):
@classmethod
def setup_class(cls):
from webassets.filter import register_filter
Expand Down Expand Up @@ -75,7 +84,7 @@ class Greeter {
assert expected in ans, report_diff(expected, ans)


class TestLessFilter(TempEnvironmentHelper):
class TestLessFilter(PyTestTempEnvironmentHelper):
LESS_CODE = '''
@import "colors.less";
.box-shadow(@style, @c) when (iscolor(@c)) {
Expand Down Expand Up @@ -113,7 +122,7 @@ def test_less_with_imports(self):
"""


class TestJSXFilter(TempEnvironmentHelper):
class TestJSXFilter(PyTestTempEnvironmentHelper):
JSX_CODE = '''
import Component from 'react';
Expand Down

0 comments on commit e1683f3

Please sign in to comment.