Skip to content

Commit 4862098

Browse files
author
beyondgeeks
committed
Fix/simplify existing tests
1 parent 8574a80 commit 4862098

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

pytest_django/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def _classmethod_is_defined_at_leaf(cls, method_name):
273273
break
274274

275275
assert super_method is not None, (
276-
'%s could not be found in base class' % method_name)
276+
'%s could not be found in base classes' % method_name)
277277

278278
method = getattr(cls, method_name)
279279

tests/test_unittest.py

+12-15
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,12 @@ def test_bar21(self):
165165
pass
166166
''')
167167

168-
result = django_testdir.runpytest_subprocess('-v', '-s')
168+
result = django_testdir.runpytest_subprocess('-v')
169169
result.stdout.fnmatch_lines([
170-
"*TestFoo::test_shared Creating test database for*",
171-
"PASSED",
172-
"*TestBar::test_bar1 PASSED",
173-
"*TestBar::test_shared PASSED",
174-
"*TestBar2::test_bar21 PASSED",
170+
"*TestFoo::test_shared PASSED*",
171+
"*TestBar::test_bar1 PASSED*",
172+
"*TestBar::test_shared PASSED*",
173+
"*TestBar2::test_bar21 PASSED*",
175174
"*TestBar2::test_shared PASSED*",
176175
])
177176
assert result.ret == 0
@@ -196,10 +195,9 @@ def test_bar(self):
196195
pass
197196
''')
198197

199-
result = django_testdir.runpytest_subprocess('-v', '-s', '--pdb')
198+
result = django_testdir.runpytest_subprocess('-v')
200199
result.stdout.fnmatch_lines([
201-
"*TestFoo::test_foo Creating test database for*",
202-
"PASSED",
200+
"*TestFoo::test_foo PASSED*",
203201
"*TestBar::test_bar PASSED*",
204202
])
205203
assert result.ret == 0
@@ -231,13 +229,12 @@ def test_bar21(self):
231229
pass
232230
''')
233231

234-
result = django_testdir.runpytest_subprocess('-v', '-s')
232+
result = django_testdir.runpytest_subprocess('-v')
235233
result.stdout.fnmatch_lines([
236-
"*TestFoo::test_shared Creating test database for*",
237-
"SKIPPED",
238-
"*TestBar::test_bar1 PASSED",
239-
"*TestBar::test_shared PASSED",
240-
"*TestBar2::test_bar21 PASSED",
234+
"*TestFoo::test_shared SKIPPED*",
235+
"*TestBar::test_bar1 PASSED*",
236+
"*TestBar::test_shared PASSED*",
237+
"*TestBar2::test_bar21 PASSED*",
241238
"*TestBar2::test_shared PASSED*",
242239
])
243240
assert result.ret == 0

0 commit comments

Comments
 (0)