Skip to content

Commit

Permalink
Merge pull request #13 from gleb-sevruk/#12_skipped_tests_show_as_suc…
Browse files Browse the repository at this point in the history
…cess

#12 Skipped tests should not show as fails
  • Loading branch information
gleb-britecore authored Mar 5, 2020
2 parents 267ac42 + 6c7ce65 commit 53afbf7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pycrunch/plugins/pytest_support/interception_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def pytest_runtest_logreport(self, report):
pass

if report.when == 'call':
if report.outcome == 'skipped':
self.passed_tests.add(report.nodeid)
return
if report.passed:
self.passed_tests.add(report.nodeid)
if not report.passed:
Expand Down
22 changes: 22 additions & 0 deletions pycrunch/tests/test_case_with_skip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from unittest import TestCase, skip


class TestWithSkips(TestCase):
def setUp(self) -> None:
# by some reason skipped test without reason still runs setup
pass

@skip
def test_should_be_skipped(self):
print('this should show as success in pycrunch report')

@skip('reason')
def test_should_be_skipped_with_reason(self):
# py.test reporter seems to use different algo to skip test with reason and without
# make sure both of them works

print('this should show as success in pycrunch report')

def test_alongside_with_skipped(self):
assert True

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
from distutils.core import setup

setup(name='pycrunch-engine',
version='0.9.0',
version='0.9.1',
description='Automatic Test Runner Engine',
url='http://github.com/gleb-sevruk/pycrunch-engine',
author='Gleb Sevruk',
author_email='support@pycrunch.com',
license='libpng',
keywords="tdd unit-testing test runner",
packages=setuptools.find_packages(),
download_url='https://github.com/gleb-sevruk/pycrunch-engine/archive/v0.9.0.tar.gz',
download_url='https://github.com/gleb-sevruk/pycrunch-engine/archive/v0.9.1.tar.gz',
setup_requires=['wheel'],
entry_points={
'console_scripts': ['pycrunch-engine=pycrunch.main:run'],
Expand Down

0 comments on commit 53afbf7

Please sign in to comment.