From dece4d25b136a493dfeeeb516487d4d756bc69e9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 1 Jan 2020 18:27:30 -0800 Subject: Resync through project.rst after moving tests directory --- docs/narr/myproject/MANIFEST.in | 3 +++ docs/narr/myproject/myproject/tests.py | 39 ---------------------------------- docs/narr/myproject/pytest.ini | 7 ++++-- docs/narr/myproject/tests/__init__.py | 0 docs/narr/myproject/tests/test_it.py | 39 ++++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 41 deletions(-) delete mode 100644 docs/narr/myproject/myproject/tests.py create mode 100644 docs/narr/myproject/tests/__init__.py create mode 100644 docs/narr/myproject/tests/test_it.py (limited to 'docs/narr/myproject') diff --git a/docs/narr/myproject/MANIFEST.in b/docs/narr/myproject/MANIFEST.in index 1c24b8c0c..f516697f5 100644 --- a/docs/narr/myproject/MANIFEST.in +++ b/docs/narr/myproject/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include myproject *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/narr/myproject/myproject/tests.py b/docs/narr/myproject/myproject/tests.py deleted file mode 100644 index 48f0095ad..000000000 --- a/docs/narr/myproject/myproject/tests.py +++ /dev/null @@ -1,39 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproject') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - - -class FunctionalTests(unittest.TestCase): - def setUp(self): - from myproject import main - app = main({}) - from webtest import TestApp - self.testapp = TestApp(app) - - def test_root(self): - res = self.testapp.get('/', status=200) - self.assertTrue(b'Pyramid' in res.body) - - def test_notfound(self): - res = self.testapp.get('/badurl', status=404) - self.assertTrue(res.status_code == 404) diff --git a/docs/narr/myproject/pytest.ini b/docs/narr/myproject/pytest.ini index 332cf0d04..5c8c59068 100644 --- a/docs/narr/myproject/pytest.ini +++ b/docs/narr/myproject/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = myproject -python_files = test*.py +addopts = --strict + +testpaths = + myproject + tests diff --git a/docs/narr/myproject/tests/__init__.py b/docs/narr/myproject/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/narr/myproject/tests/test_it.py b/docs/narr/myproject/tests/test_it.py new file mode 100644 index 000000000..b300da34d --- /dev/null +++ b/docs/narr/myproject/tests/test_it.py @@ -0,0 +1,39 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from myproject.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproject') + + def test_notfound_view(self): + from myproject.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + + +class FunctionalTests(unittest.TestCase): + def setUp(self): + from myproject import main + app = main({}) + from webtest import TestApp + self.testapp = TestApp(app) + + def test_root(self): + res = self.testapp.get('/', status=200) + self.assertTrue(b'Pyramid' in res.body) + + def test_notfound(self): + res = self.testapp.get('/badurl', status=404) + self.assertTrue(res.status_code == 404) -- cgit v1.2.3