diff --git a/psutil/tests/test_bsd.py b/psutil/tests/test_bsd.py index 72cfb068a..c836dfd5c 100755 --- a/psutil/tests/test_bsd.py +++ b/psutil/tests/test_bsd.py @@ -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 diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py index b0aefa0e2..2f58cd172 100755 --- a/psutil/tests/test_contracts.py +++ b/psutil/tests/test_contracts.py @@ -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(): @@ -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): diff --git a/psutil/tests/test_memleaks.py b/psutil/tests/test_memleaks.py index 32c69b3e7..697baf0b5 100755 --- a/psutil/tests/test_memleaks.py +++ b/psutil/tests/test_memleaks.py @@ -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): @@ -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)) diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index eaa965fd9..3a4275c80 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -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') diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index 4132b4168..a0e5199ec 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -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: @@ -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() @@ -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] @@ -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() diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index 35387b2ce..da1da930b 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -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: