]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Rename testsuite to tests and suggestions 426/head
authorKartheek Lenkala <lkarthee@gmail.com>
Sun, 22 Mar 2015 12:33:14 +0000 (18:03 +0530)
committerKartheek Lenkala <lkarthee@gmail.com>
Sun, 22 Mar 2015 12:33:14 +0000 (18:03 +0530)
Remove  py.test from setup.py install_requires
Rename testsuite folder to tests.

23 files changed:
Makefile
setup.py
tests/conftest.py [moved from testsuite/conftest.py with 100% similarity]
tests/res/__init__.py [moved from testsuite/res/__init__.py with 100% similarity]
tests/res/templates/broken.html [moved from testsuite/res/templates/broken.html with 100% similarity]
tests/res/templates/foo/test.html [moved from testsuite/res/templates/foo/test.html with 100% similarity]
tests/res/templates/syntaxerror.html [moved from testsuite/res/templates/syntaxerror.html with 100% similarity]
tests/res/templates/test.html [moved from testsuite/res/templates/test.html with 100% similarity]
tests/test_api.py [moved from testsuite/test_api.py with 96% similarity]
tests/test_bytecode_cache.py [moved from testsuite/test_bytecode_cache.py with 100% similarity]
tests/test_core_tags.py [moved from testsuite/test_core_tags.py with 100% similarity]
tests/test_debug.py [moved from testsuite/test_debug.py with 100% similarity]
tests/test_ext.py [moved from testsuite/test_ext.py with 100% similarity]
tests/test_filters.py [moved from testsuite/test_filters.py with 100% similarity]
tests/test_imports.py [moved from testsuite/test_imports.py with 100% similarity]
tests/test_inheritance.py [moved from testsuite/test_inheritance.py with 100% similarity]
tests/test_lexnparse.py [moved from testsuite/test_lexnparse.py with 100% similarity]
tests/test_loader.py [moved from testsuite/test_loader.py with 100% similarity]
tests/test_regression.py [moved from testsuite/test_regression.py with 100% similarity]
tests/test_security.py [moved from testsuite/test_security.py with 100% similarity]
tests/test_tests.py [moved from testsuite/test_tests.py with 100% similarity]
tests/test_utils.py [moved from testsuite/test_utils.py with 100% similarity]
tox.ini

index 79db0f5717f1fd63120fb694771ee1da5fe36b8d..aadaaa94319a9e504783eac7e4ff70766a74782b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 test:
-       py.test --doctest-modules testsuite jinja2
+       py.test
 
 develop:
        pip install --editable .
index 7b3b7b6fb8c9d2bfdc699accbb6f99ea28576078..2cf3106f0c3edff04e16210570935f539de87480 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -72,10 +72,7 @@ setup(
         'Topic :: Text Processing :: Markup :: HTML'
     ],
     packages=['jinja2'],
-    install_requires=[
-        'MarkupSafe',
-        'pytest'
-    ],
+    install_requires=['MarkupSafe'],
     extras_require={'i18n': ['Babel>=0.8']},
     include_package_data=True,
     entry_points="""
similarity index 100%
rename from testsuite/conftest.py
rename to tests/conftest.py
similarity index 96%
rename from testsuite/test_api.py
rename to tests/test_api.py
index 37617f2ab7d4b55cf9789e8a33387c7e6ddfbbca..40a6b3dc9d1d67b470a1859ed14341b9e5fdc5c1 100644 (file)
@@ -188,7 +188,7 @@ class TestStreaming():
 @pytest.mark.undefined
 class TestUndefined():
 
-    def test_stopiteration_is_undefined(self, env):
+    def test_stopiteration_is_undefined(self):
         def test():
             raise StopIteration()
         t = Template('A{{ test() }}B')
@@ -196,7 +196,7 @@ class TestUndefined():
         t = Template('A{{ test().missingattribute }}B')
         pytest.raises(UndefinedError, t.render, test=test)
 
-    def test_undefined_and_special_attributes(self, env):
+    def test_undefined_and_special_attributes(self):
         try:
             Undefined('Foo').__dict__
         except AttributeError:
@@ -204,7 +204,7 @@ class TestUndefined():
         else:
             assert False, "Expected actual attribute error"
 
-    def test_logging_undefined(self, env):
+    def test_logging_undefined(self):
         _messages = []
 
         class DebugLogger(object):
@@ -232,7 +232,7 @@ class TestUndefined():
             'W:Template variable warning: missing is undefined',
         ]
 
-    def test_default_undefined(self, env):
+    def test_default_undefined(self):
         env = Environment(undefined=Undefined)
         assert env.from_string('{{ missing }}').render() == u''
         pytest.raises(UndefinedError,
@@ -243,7 +243,7 @@ class TestUndefined():
         assert env.from_string('{{ foo.missing }}').render(foo=42) == ''
         assert env.from_string('{{ not missing }}').render() == 'True'
 
-    def test_debug_undefined(self, env):
+    def test_debug_undefined(self):
         env = Environment(undefined=DebugUndefined)
         assert env.from_string('{{ missing }}').render() == '{{ missing }}'
         pytest.raises(UndefinedError,
@@ -255,7 +255,7 @@ class TestUndefined():
             == u"{{ no such element: int object['missing'] }}"
         assert env.from_string('{{ not missing }}').render() == 'True'
 
-    def test_strict_undefined(self, env):
+    def test_strict_undefined(self):
         env = Environment(undefined=StrictUndefined)
         pytest.raises(UndefinedError, env.from_string('{{ missing }}').render)
         pytest.raises(UndefinedError,
@@ -271,11 +271,11 @@ class TestUndefined():
         assert env.from_string('{{ missing|default("default", true) }}')\
             .render() == 'default'
 
-    def test_indexing_gives_undefined(self, env):
+    def test_indexing_gives_undefined(self):
         t = Template("{{ var[42].foo }}")
         pytest.raises(UndefinedError, t.render, var=0)
 
-    def test_none_gives_proper_error(self, env):
+    def test_none_gives_proper_error(self):
         try:
             Environment().getattr(None, 'split')()
         except UndefinedError as e:
@@ -283,7 +283,7 @@ class TestUndefined():
         else:
             assert False, 'expected exception'
 
-    def test_object_repr(self, env):
+    def test_object_repr(self):
         try:
             Undefined(obj=42, name='upper')()
         except UndefinedError as e:
similarity index 100%
rename from testsuite/test_debug.py
rename to tests/test_debug.py
similarity index 100%
rename from testsuite/test_ext.py
rename to tests/test_ext.py
similarity index 100%
rename from testsuite/test_tests.py
rename to tests/test_tests.py
similarity index 100%
rename from testsuite/test_utils.py
rename to tests/test_utils.py
diff --git a/tox.ini b/tox.ini
index ff5125bb74deed4688375368b6fb11820721e210..d5079b934b17136c29c206e6e01f797310759d00 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -2,4 +2,8 @@
 envlist = py26, py27, pypy, py33, py34
 
 [testenv]
-commands = py.test --doctest-modules testsuite jinja2
+commands =
+  py.test []
+
+deps =
+  pytest