Skip to content

Commit

Permalink
refact
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Dec 18, 2023
1 parent a5bc666 commit de9a32a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,6 @@ def wait_for_pid(pid):
if WINDOWS:
# give it some more time to allow better initialization
time.sleep(0.01)
print("PROCESS INITIALIZED") # noqa


@retry(exception=(FileNotFoundError, AssertionError), logfun=None,
Expand Down
16 changes: 13 additions & 3 deletions psutil/tests/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,18 @@ def try_unicode(suffix):
class BaseUnicodeTest(PsutilTestCase):
funky_suffix = None

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.skip_tests = False
if cls.funky_suffix is not None:
if not try_unicode(cls.funky_suffix):
cls.skip_tests = True

def setUp(self):
if self.funky_suffix is not None:
if not try_unicode(self.funky_suffix):
raise self.skipTest("can't handle unicode str")
super().setUp()
if self.skip_tests:
raise self.skipTest("can't handle unicode str")


@serialrun
Expand All @@ -174,11 +182,13 @@ class TestFSAPIs(BaseUnicodeTest):

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.funky_name = get_testfn(suffix=cls.funky_suffix)
create_exe(cls.funky_name)

@classmethod
def tearDownClass(cls):
super().tearDownClass()
safe_rmpath(cls.funky_name)

def expect_exact_path_match(self):
Expand Down

0 comments on commit de9a32a

Please sign in to comment.