Skip to content

Commit

Permalink
fix py2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 15, 2024
1 parent 60abc7d commit b7ea60f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
'unittest', 'skip_on_access_denied', 'skip_on_not_implemented',
'retry_on_failure', 'TestMemoryLeak', 'PsutilTestCase',
'process_namespace', 'system_namespace', 'print_sysinfo',
'is_win_secure_system_proc',
'is_win_secure_system_proc', 'fake_pytest',
# fs utils
'chdir', 'safe_rmpath', 'create_py_exe', 'create_c_exe', 'get_testfn',
# os
Expand Down
5 changes: 3 additions & 2 deletions psutil/tests/test_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from psutil._common import open_binary
from psutil._common import open_text
from psutil._common import supports_ipv6
from psutil._compat import PY3
from psutil.tests import CI_TESTING
from psutil.tests import COVERAGE
from psutil.tests import HAS_NET_CONNECTIONS_UNIX
Expand Down Expand Up @@ -506,12 +507,12 @@ def foo(self):
assert result.wasSuccessful()
assert len(result.skipped) == 0

@pytest.mark.skipif(not PY3, reason="not PY3")
def test_skip(self):
class TestCase(unittest.TestCase):
def foo(self):
fake_pytest.skip("reason")

assert 1 == 1 # noqa
assert 1 == 0 # noqa

result = self.run_test_class(TestCase("foo"))
assert result.wasSuccessful()
Expand Down

0 comments on commit b7ea60f

Please sign in to comment.