Skip to content

Commit

Permalink
use double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 14, 2024
1 parent 1468769 commit f145ac4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions psutil/tests/test_bsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def test_cpu_count_logical(self):

@pytest.mark.skipif(not which('sysctl'), reason="sysctl cmd not available")
@pytest.mark.skipif(
NETBSD, reason="skipped on NETBSD"
) # we check /proc/meminfo
NETBSD, reason="skipped on NETBSD" # we check /proc/meminfo
)
def test_virtual_memory_total(self):
num = sysctl('hw.physmem')
assert num == psutil.virtual_memory().total
Expand Down
4 changes: 2 additions & 2 deletions psutil/tests/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_net_if_addrs(self):
assert isinstance(addr.netmask, (str, type(None)))
assert isinstance(addr.broadcast, (str, type(None)))

@pytest.mark.skipif(QEMU_USER, reason='QEMU user not supported')
@pytest.mark.skipif(QEMU_USER, reason="QEMU user not supported")
def test_net_if_stats(self):
# Duplicate of test_system.py. Keep it anyway.
for ifname, info in psutil.net_if_stats().items():
Expand All @@ -288,7 +288,7 @@ def test_net_if_stats(self):
assert isinstance(info.speed, int)
assert isinstance(info.mtu, int)

@pytest.mark.skipif(not HAS_NET_IO_COUNTERS, reason='not supported')
@pytest.mark.skipif(not HAS_NET_IO_COUNTERS, reason="not supported")
def test_net_io_counters(self):
# Duplicate of test_system.py. Keep it anyway.
for ifname in psutil.net_io_counters(pernic=True):
Expand Down
4 changes: 2 additions & 2 deletions psutil/tests/test_memleaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def test_disk_partitions(self):

@pytest.mark.skipif(
LINUX and not os.path.exists('/proc/diskstats'),
reason='/proc/diskstats not available on this Linux version',
reason="/proc/diskstats not available on this Linux version",
)
@fewtimes_if_linux()
def test_disk_io_counters(self):
Expand All @@ -420,7 +420,7 @@ def test_pids(self):
# --- net

@fewtimes_if_linux()
@pytest.mark.skipif(not HAS_NET_IO_COUNTERS, reason='not supported')
@pytest.mark.skipif(not HAS_NET_IO_COUNTERS, reason="not supported")
def test_net_io_counters(self):
self.execute(lambda: psutil.net_io_counters(nowrap=False))

Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def test_pstree(self):
def test_netstat(self):
self.assert_stdout('netstat.py')

@pytest.mark.skipif(QEMU_USER, reason='QEMU user not supported')
@pytest.mark.skipif(QEMU_USER, reason="QEMU user not supported")
def test_ifconfig(self):
self.assert_stdout('ifconfig.py')

Expand Down
8 changes: 4 additions & 4 deletions psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def test_threads(self):

@retry_on_failure()
@skip_on_access_denied(only_if=MACOS)
@pytest.mark.skipif(not HAS_THREADS, reason='not supported')
@pytest.mark.skipif(not HAS_THREADS, reason="not supported")
def test_threads_2(self):
p = self.spawn_psproc()
if OPENBSD:
Expand Down Expand Up @@ -991,7 +991,7 @@ def test_cwd_2(self):
p = self.spawn_psproc(cmd)
call_until(lambda: p.cwd() == os.path.dirname(os.getcwd()))

@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason='not supported')
@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason="not supported")
def test_cpu_affinity(self):
p = psutil.Process()
initial = p.cpu_affinity()
Expand Down Expand Up @@ -1030,7 +1030,7 @@ def test_cpu_affinity(self):
p.cpu_affinity(set(all_cpus))
p.cpu_affinity(tuple(all_cpus))

@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason='not supported')
@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason="not supported")
def test_cpu_affinity_errs(self):
p = self.spawn_psproc()
invalid_cpu = [len(psutil.cpu_times(percpu=True)) + 10]
Expand All @@ -1043,7 +1043,7 @@ def test_cpu_affinity_errs(self):
with pytest.raises(ValueError):
p.cpu_affinity([0, -1])

@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason='not supported')
@pytest.mark.skipif(not HAS_CPU_AFFINITY, reason="not supported")
def test_cpu_affinity_all_combinations(self):
p = psutil.Process()
initial = p.cpu_affinity()
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def wmic(path, what, converter=int):
class TestCpuAPIs(WindowsTestCase):
@pytest.mark.skipif(
'NUMBER_OF_PROCESSORS' not in os.environ,
reason='NUMBER_OF_PROCESSORS env var is not available',
reason="NUMBER_OF_PROCESSORS env var is not available",
)
def test_cpu_count_vs_NUMBER_OF_PROCESSORS(self):
# Will likely fail on many-cores systems:
Expand Down

0 comments on commit f145ac4

Please sign in to comment.