]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
remove custom pytest marks
authorDavid Lord <davidism@gmail.com>
Thu, 6 Feb 2020 04:23:47 +0000 (20:23 -0800)
committerDavid Lord <davidism@gmail.com>
Thu, 6 Feb 2020 04:23:47 +0000 (20:23 -0800)
16 files changed:
tests/conftest.py
tests/test_api.py
tests/test_async.py
tests/test_bytecode_cache.py
tests/test_core_tags.py
tests/test_debug.py
tests/test_ext.py
tests/test_filters.py
tests/test_imports.py
tests/test_inheritance.py
tests/test_lexnparse.py
tests/test_loader.py
tests/test_regression.py
tests/test_security.py
tests/test_tests.py
tests/test_utils.py

index bb26409a5ca4195dfd16b9bc52a589b397057888..23088a334033bb883414346051be05410db43153 100644 (file)
@@ -14,50 +14,6 @@ def pytest_ignore_collect(path):
     return False
 
 
-def pytest_configure(config):
-    """Register custom marks for test categories."""
-    custom_markers = [
-        "api",
-        "byte_code_cache",
-        "core_tags",
-        "debug",
-        "escapeUrlizeTarget",
-        "ext",
-        "extended",
-        "filesystemloader",
-        "filter",
-        "for_loop",
-        "helpers",
-        "if_condition",
-        "imports",
-        "includes",
-        "inheritance",
-        "lexer",
-        "lexnparse",
-        "loaders",
-        "loremIpsum",
-        "lowlevel",
-        "lrucache",
-        "lstripblocks",
-        "macros",
-        "meta",
-        "moduleloader",
-        "parser",
-        "regression",
-        "sandbox",
-        "set",
-        "streaming",
-        "syntax",
-        "test_tests",
-        "tokenstream",
-        "undefined",
-        "utils",
-        "with_",
-    ]
-    for mark in custom_markers:
-        config.addinivalue_line("markers", mark + ": test category")
-
-
 @pytest.fixture
 def env():
     """returns a new environment."""
index 0c262dc4b85bb6244c08370fb41465e44ff03bee..058ec56cb9941dbcc9965dd31bf4b8e798db15b7 100644 (file)
@@ -25,8 +25,6 @@ from jinja2.utils import environmentfunction
 from jinja2.utils import evalcontextfunction
 
 
-@pytest.mark.api
-@pytest.mark.extended
 class TestExtendedAPI(object):
     def test_item_and_attribute(self, env):
         from jinja2.sandbox import SandboxedEnvironment
@@ -163,8 +161,6 @@ class TestExtendedAPI(object):
             t.render(total=MAX_RANGE + 1)
 
 
-@pytest.mark.api
-@pytest.mark.meta
 class TestMeta(object):
     def test_find_undeclared_variables(self, env):
         ast = env.parse("{% set foo = 42 %}{{ bar + foo }}")
@@ -218,8 +214,6 @@ class TestMeta(object):
         assert list(i) == ["foo.html", "bar.html", None]
 
 
-@pytest.mark.api
-@pytest.mark.streaming
 class TestStreaming(object):
     def test_basic_streaming(self, env):
         t = env.from_string(
@@ -261,8 +255,6 @@ class TestStreaming(object):
             shutil.rmtree(tmp)
 
 
-@pytest.mark.api
-@pytest.mark.undefined
 class TestUndefined(object):
     def test_stopiteration_is_undefined(self):
         def test():
@@ -400,8 +392,6 @@ class TestUndefined(object):
             Undefined(obj=42, name="upper")()
 
 
-@pytest.mark.api
-@pytest.mark.lowlevel
 class TestLowLevel(object):
     def test_custom_code_generator(self):
         class CustomCodeGenerator(CodeGenerator):
index d6c4a239aa20a6d32d246c75e502f525d65d29fe..11efd849f062918d8f0b78100f6e51bb0f813e68 100644 (file)
@@ -130,7 +130,6 @@ def test_env_async():
     return env
 
 
-@pytest.mark.imports
 class TestAsyncImports(object):
     def test_context_imports(self, test_env_async):
         t = test_env_async.from_string('{% import "module" as m %}{{ m.test() }}')
@@ -180,8 +179,6 @@ class TestAsyncImports(object):
         assert not hasattr(m, "notthere")
 
 
-@pytest.mark.imports
-@pytest.mark.includes
 class TestAsyncIncludes(object):
     def test_context_include(self, test_env_async):
         t = test_env_async.from_string('{% include "header" %}')
@@ -279,8 +276,6 @@ class TestAsyncIncludes(object):
         assert t.render().strip() == "(FOO)"
 
 
-@pytest.mark.core_tags
-@pytest.mark.for_loop
 class TestAsyncForLoop(object):
     def test_simple(self, test_env_async):
         tmpl = test_env_async.from_string("{% for item in seq %}{{ item }}{% endfor %}")
index 2970cb5c182a07b2695ece949e80c366b56c3eff..c7882b1a2dff063efcdf6b2b89f27e5a6e951051 100644 (file)
@@ -14,7 +14,6 @@ def env(package_loader, tmp_path):
     return Environment(loader=package_loader, bytecode_cache=bytecode_cache)
 
 
-@pytest.mark.byte_code_cache
 class TestByteCodeCache(object):
     def test_simple(self, env):
         tmpl = env.get_template("test.html")
index 4132c4f5ea25cac64e9646afa9ae1c008939a809..1bd96c41e98cfd2066c35707f711edd27fe87a9e 100644 (file)
@@ -13,8 +13,6 @@ def env_trim():
     return Environment(trim_blocks=True)
 
 
-@pytest.mark.core_tags
-@pytest.mark.for_loop
 class TestForLoop(object):
     def test_simple(self, env):
         tmpl = env.from_string("{% for item in seq %}{{ item }}{% endfor %}")
@@ -305,8 +303,6 @@ class TestForLoop(object):
         assert tmpl.render(x=0, seq=[1, 2, 3]) == "919293"
 
 
-@pytest.mark.core_tags
-@pytest.mark.if_condition
 class TestIfCondition(object):
     def test_simple(self, env):
         tmpl = env.from_string("""{% if true %}...{% endif %}""")
@@ -349,8 +345,6 @@ class TestIfCondition(object):
         assert tmpl.render() == "1"
 
 
-@pytest.mark.core_tags
-@pytest.mark.macros
 class TestMacros(object):
     def test_simple(self, env_trim):
         tmpl = env_trim.from_string(
@@ -475,8 +469,6 @@ class TestMacros(object):
         assert tmpl.module.m(1, x=7) == "1|7|7"
 
 
-@pytest.mark.core_tags
-@pytest.mark.set
 class TestSet(object):
     def test_normal(self, env_trim):
         tmpl = env_trim.from_string("{% set foo = 1 %}{{ foo }}")
@@ -584,8 +576,6 @@ class TestSet(object):
         assert tmpl.module.foo == u"11"
 
 
-@pytest.mark.core_tags
-@pytest.mark.with_
 class TestWith(object):
     def test_with(self, env):
         tmpl = env.from_string(
index 5ca92d92d098d86e78fa54e3a4720692ac171684..284b9e91a5bd9516982316fadb387c2c58bddd24 100644 (file)
@@ -17,7 +17,6 @@ def fs_env(filesystem_loader):
     return Environment(loader=filesystem_loader)
 
 
-@pytest.mark.debug
 class TestDebug(object):
     def assert_traceback_matches(self, callback, expected_tb):
         with pytest.raises(Exception) as exc_info:
index 67d2cdb5259e01f15540bf99e89dd3e87e216ef6..8e4b411e1bafc070fb8ed1106e3df16523b6991c 100644 (file)
@@ -167,7 +167,6 @@ class StreamFilterExtension(Extension):
             yield Token(lineno, "data", token.value[pos:])
 
 
-@pytest.mark.ext
 class TestExtensions(object):
     def test_extend_late(self):
         env = Environment()
@@ -267,7 +266,6 @@ class TestExtensions(object):
             assert "'{}'".format(value) in out
 
 
-@pytest.mark.ext
 class TestInternationalization(object):
     def test_trans(self):
         tmpl = i18n_env.get_template("child.html")
@@ -418,7 +416,6 @@ class TestInternationalization(object):
         ]
 
 
-@pytest.mark.ext
 class TestScope(object):
     def test_basic_scope_behavior(self):
         # This is what the old with statement compiled down to
@@ -452,7 +449,6 @@ class TestScope(object):
         assert tmpl.render(b=3, e=4) == "1|2|2|4|5"
 
 
-@pytest.mark.ext
 class TestNewstyleInternationalization(object):
     def test_trans(self):
         tmpl = newstyle_i18n_env.get_template("child.html")
@@ -544,7 +540,6 @@ class TestNewstyleInternationalization(object):
         assert t.render() == "%(foo)s"
 
 
-@pytest.mark.ext
 class TestAutoEscape(object):
     def test_scoped_setting(self):
         env = Environment(extensions=["jinja2.ext.autoescape"], autoescape=True)
index 109f4441f8e05b3bc6ddd32873b81abea868a460..37dde44d5c2939289c29bddf6df1674fa6a39021 100644 (file)
@@ -29,7 +29,6 @@ class Magic2(object):
         return u"(%s,%s)" % (text_type(self.value1), text_type(self.value2))
 
 
-@pytest.mark.filter
 class TestFilter(object):
     def test_filter_calling(self, env):
         rv = env.call_filter("sum", [1, 2, 3])
index 0dae2173f22625a42d5443638377c90bb48d5717..fad2edafb690fa65ba438940273b8944eec67197 100644 (file)
@@ -23,7 +23,6 @@ def test_env():
     return env
 
 
-@pytest.mark.imports
 class TestImports(object):
     def test_context_imports(self, test_env):
         t = test_env.from_string('{% import "module" as m %}{{ m.test() }}')
@@ -94,8 +93,6 @@ class TestImports(object):
         assert not hasattr(m, "notthere")
 
 
-@pytest.mark.imports
-@pytest.mark.includes
 class TestIncludes(object):
     def test_context_include(self, test_env):
         t = test_env.from_string('{% include "header" %}')
index 92f66e04fb9d18b4145480705649dc1b4c7306f9..e513d2e3eb3f2baacc1e2b8a64d4f2f6c9165d04 100644 (file)
@@ -74,7 +74,6 @@ def env():
     )
 
 
-@pytest.mark.inheritance
 class TestInheritance(object):
     def test_layout(self, env):
         tmpl = env.get_template("layout")
@@ -233,7 +232,6 @@ class TestInheritance(object):
         assert rv == ["43", "44", "45"]
 
 
-@pytest.mark.inheritance
 class TestBugFix(object):
     def test_fixed_macro_scoping_bug(self, env):
         assert (
index 9da9380581112b0a14c558bf3b15a36fb657a7c9..e799acdcbadeb310d5bf50e4d9faee7becd58f82 100644 (file)
@@ -27,8 +27,6 @@ else:
     jinja_string_repr = repr
 
 
-@pytest.mark.lexnparse
-@pytest.mark.tokenstream
 class TestTokenStream(object):
     test_tokens = [
         Token(1, TOKEN_BLOCK_BEGIN, ""),
@@ -57,8 +55,6 @@ class TestTokenStream(object):
         ]
 
 
-@pytest.mark.lexnparse
-@pytest.mark.lexer
 class TestLexer(object):
     def test_raw1(self, env):
         tmpl = env.from_string(
@@ -183,8 +179,6 @@ class TestLexer(object):
             pytest.raises(TemplateSyntaxError, env.from_string, t)
 
 
-@pytest.mark.lexnparse
-@pytest.mark.parser
 class TestParser(object):
     def test_php_syntax(self, env):
         env = Environment("<?", "?>", "<?=", "?>", "<!--", "-->")
@@ -318,8 +312,6 @@ and bar comment #}
         assert_error("{% unknown_tag %}", "Encountered unknown tag 'unknown_tag'.")
 
 
-@pytest.mark.lexnparse
-@pytest.mark.syntax
 class TestSyntax(object):
     def test_call(self, env):
         env = Environment()
@@ -575,8 +567,6 @@ class TestSyntax(object):
         assert tmpl.render(foo={"bar": 42}) == "42"
 
 
-@pytest.mark.lexnparse
-@pytest.mark.lstripblocks
 class TestLstripBlocks(object):
     def test_lstrip(self, env):
         env = Environment(lstrip_blocks=True, trim_blocks=False)
index 4aa6511ef2a57fe00d0822c77b56ec6bd6ff25ee..71e00b253f041496dbb3c9338fd794ef18758319 100644 (file)
@@ -17,7 +17,6 @@ from jinja2.exceptions import TemplateNotFound
 from jinja2.loaders import split_template_path
 
 
-@pytest.mark.loaders
 class TestLoaders(object):
     def test_dict_loader(self, dict_loader):
         env = Environment(loader=dict_loader)
@@ -117,8 +116,6 @@ class TestLoaders(object):
         pytest.raises(TemplateNotFound, split_template_path, "../foo")
 
 
-@pytest.mark.loaders
-@pytest.mark.filesystemloader
 class TestFileSystemLoader(object):
     searchpath = os.path.join(
         os.path.dirname(os.path.abspath(__file__)), "res", "templates"
@@ -186,8 +183,6 @@ class TestFileSystemLoader(object):
         assert t.render() == expect
 
 
-@pytest.mark.loaders
-@pytest.mark.moduleloader
 class TestModuleLoader(object):
     archive = None
 
index accc1f62a48cb2ccac7416216ba636583a4c61d6..c5a0d680684852240d3769b3bfe9e277e13a7c9a 100644 (file)
@@ -13,7 +13,6 @@ from jinja2 import TemplateSyntaxError
 from jinja2._compat import text_type
 
 
-@pytest.mark.regression
 class TestCorner(object):
     def test_assigned_scoping(self, env):
         t = env.from_string(
@@ -85,7 +84,6 @@ class TestCorner(object):
         assert t.render(wrapper=23) == "[1][2][3][4]23"
 
 
-@pytest.mark.regression
 class TestBug(object):
     def test_keyword_folding(self, env):
         env = Environment()
index f092c96d95284775a58fab7d43913d0ca3369ae4..7e8974c891b51289f06f97428d8b38b411c4ee41 100644 (file)
@@ -37,7 +37,6 @@ class PublicStuff(object):
         return "PublicStuff"
 
 
-@pytest.mark.sandbox
 class TestSandbox(object):
     def test_unsafe(self, env):
         env = SandboxedEnvironment()
@@ -167,7 +166,6 @@ class TestSandbox(object):
                 t.render(ctx)
 
 
-@pytest.mark.sandbox
 class TestStringFormat(object):
     def test_basic_format_safety(self):
         env = SandboxedEnvironment()
@@ -190,7 +188,6 @@ class TestStringFormat(object):
         assert t.render() == "a42b&lt;foo&gt;"
 
 
-@pytest.mark.sandbox
 @pytest.mark.skipif(
     not hasattr(str, "format_map"), reason="requires str.format_map method"
 )
index 42595e8fd6cee1e6e0058a9b0c62db21bfa5abd7..b903e3b1e2f98666a11bf5ea883355b913402c05 100644 (file)
@@ -9,7 +9,6 @@ class MyDict(dict):
     pass
 
 
-@pytest.mark.test_tests
 class TestTestsCase(object):
     def test_defined(self, env):
         tmpl = env.from_string("{{ missing is defined }}|{{ true is defined }}")
index 58165efbf09bc9e53bd5c391c5ce25cd7f31146b..b379a97ac641f3a0eec92aa0db4c71a6b66aff81 100644 (file)
@@ -18,8 +18,6 @@ from jinja2.utils import select_autoescape
 from jinja2.utils import urlize
 
 
-@pytest.mark.utils
-@pytest.mark.lrucache
 class TestLRUCache(object):
     def test_simple(self):
         d = LRUCache(3)
@@ -120,8 +118,6 @@ class TestLRUCache(object):
         assert len(d) == 2
 
 
-@pytest.mark.utils
-@pytest.mark.helpers
 class TestHelpers(object):
     def test_object_type_repr(self):
         class X(object):
@@ -150,8 +146,6 @@ class TestHelpers(object):
         assert not func("FOO.TXT")
 
 
-@pytest.mark.utils
-@pytest.mark.escapeUrlizeTarget
 class TestEscapeUrlizeTarget(object):
     def test_escape_urlize_target(self):
         url = "http://example.org"
@@ -163,8 +157,6 @@ class TestEscapeUrlizeTarget(object):
         )
 
 
-@pytest.mark.utils
-@pytest.mark.loremIpsum
 class TestLoremIpsum(object):
     def test_lorem_ipsum_markup(self):
         """Test that output of lorem_ipsum is Markup by default."""