From 3670c2cdb732d378ba6d38e72e7cd875ff726aa9 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sun, 14 Oct 2018 21:11:41 -0500 Subject: move tests out of the package --- tests/pkgs/notfoundview/__init__.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/pkgs/notfoundview/__init__.py (limited to 'tests/pkgs/notfoundview') diff --git a/tests/pkgs/notfoundview/__init__.py b/tests/pkgs/notfoundview/__init__.py new file mode 100644 index 000000000..ae148ea8c --- /dev/null +++ b/tests/pkgs/notfoundview/__init__.py @@ -0,0 +1,30 @@ +from pyramid.view import notfound_view_config, view_config +from pyramid.response import Response + +@notfound_view_config(route_name='foo', append_slash=True) +def foo_notfound(request): # pragma: no cover + return Response('foo_notfound') + +@notfound_view_config(route_name='baz') +def baz_notfound(request): + return Response('baz_notfound') + +@notfound_view_config(append_slash=True) +def notfound(request): + return Response('generic_notfound') + +@view_config(route_name='bar') +def bar(request): + return Response('OK bar') + +@view_config(route_name='foo2') +def foo2(request): + return Response('OK foo2') + +def includeme(config): + config.add_route('foo', '/foo') + config.add_route('foo2', '/foo/') + config.add_route('bar', '/bar/') + config.add_route('baz', '/baz') + config.scan('pyramid.tests.pkgs.notfoundview') + -- cgit v1.2.3 From dd3cc81f75dcb5ff96e0751653071722a15f46c2 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sun, 14 Oct 2018 23:16:48 -0500 Subject: fix the tests to import from the tests package instead of pyramid.tests --- tests/pkgs/notfoundview/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/pkgs/notfoundview') diff --git a/tests/pkgs/notfoundview/__init__.py b/tests/pkgs/notfoundview/__init__.py index ae148ea8c..8ba3ff9ed 100644 --- a/tests/pkgs/notfoundview/__init__.py +++ b/tests/pkgs/notfoundview/__init__.py @@ -26,5 +26,5 @@ def includeme(config): config.add_route('foo2', '/foo/') config.add_route('bar', '/bar/') config.add_route('baz', '/baz') - config.scan('pyramid.tests.pkgs.notfoundview') + config.scan('tests.pkgs.notfoundview') -- cgit v1.2.3