From: Kartheek Lenkala Date: Sun, 22 Mar 2015 12:33:14 +0000 (+0530) Subject: Rename testsuite to tests and suggestions X-Git-Tag: 2.8~27^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee2cb97449d9f3548060bb93aed86a52255a28f9;p=thirdparty%2Fjinja.git Rename testsuite to tests and suggestions Remove py.test from setup.py install_requires Rename testsuite folder to tests. --- diff --git a/Makefile b/Makefile index 79db0f57..aadaaa94 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ test: - py.test --doctest-modules testsuite jinja2 + py.test develop: pip install --editable . diff --git a/setup.py b/setup.py index 7b3b7b6f..2cf3106f 100644 --- 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=""" diff --git a/testsuite/conftest.py b/tests/conftest.py similarity index 100% rename from testsuite/conftest.py rename to tests/conftest.py diff --git a/testsuite/res/__init__.py b/tests/res/__init__.py similarity index 100% rename from testsuite/res/__init__.py rename to tests/res/__init__.py diff --git a/testsuite/res/templates/broken.html b/tests/res/templates/broken.html similarity index 100% rename from testsuite/res/templates/broken.html rename to tests/res/templates/broken.html diff --git a/testsuite/res/templates/foo/test.html b/tests/res/templates/foo/test.html similarity index 100% rename from testsuite/res/templates/foo/test.html rename to tests/res/templates/foo/test.html diff --git a/testsuite/res/templates/syntaxerror.html b/tests/res/templates/syntaxerror.html similarity index 100% rename from testsuite/res/templates/syntaxerror.html rename to tests/res/templates/syntaxerror.html diff --git a/testsuite/res/templates/test.html b/tests/res/templates/test.html similarity index 100% rename from testsuite/res/templates/test.html rename to tests/res/templates/test.html diff --git a/testsuite/test_api.py b/tests/test_api.py similarity index 96% rename from testsuite/test_api.py rename to tests/test_api.py index 37617f2a..40a6b3dc 100644 --- a/testsuite/test_api.py +++ b/tests/test_api.py @@ -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: diff --git a/testsuite/test_bytecode_cache.py b/tests/test_bytecode_cache.py similarity index 100% rename from testsuite/test_bytecode_cache.py rename to tests/test_bytecode_cache.py diff --git a/testsuite/test_core_tags.py b/tests/test_core_tags.py similarity index 100% rename from testsuite/test_core_tags.py rename to tests/test_core_tags.py diff --git a/testsuite/test_debug.py b/tests/test_debug.py similarity index 100% rename from testsuite/test_debug.py rename to tests/test_debug.py diff --git a/testsuite/test_ext.py b/tests/test_ext.py similarity index 100% rename from testsuite/test_ext.py rename to tests/test_ext.py diff --git a/testsuite/test_filters.py b/tests/test_filters.py similarity index 100% rename from testsuite/test_filters.py rename to tests/test_filters.py diff --git a/testsuite/test_imports.py b/tests/test_imports.py similarity index 100% rename from testsuite/test_imports.py rename to tests/test_imports.py diff --git a/testsuite/test_inheritance.py b/tests/test_inheritance.py similarity index 100% rename from testsuite/test_inheritance.py rename to tests/test_inheritance.py diff --git a/testsuite/test_lexnparse.py b/tests/test_lexnparse.py similarity index 100% rename from testsuite/test_lexnparse.py rename to tests/test_lexnparse.py diff --git a/testsuite/test_loader.py b/tests/test_loader.py similarity index 100% rename from testsuite/test_loader.py rename to tests/test_loader.py diff --git a/testsuite/test_regression.py b/tests/test_regression.py similarity index 100% rename from testsuite/test_regression.py rename to tests/test_regression.py diff --git a/testsuite/test_security.py b/tests/test_security.py similarity index 100% rename from testsuite/test_security.py rename to tests/test_security.py diff --git a/testsuite/test_tests.py b/tests/test_tests.py similarity index 100% rename from testsuite/test_tests.py rename to tests/test_tests.py diff --git a/testsuite/test_utils.py b/tests/test_utils.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 ff5125bb..d5079b93 100644 --- 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