diff --git a/CHANGELOG.md b/CHANGELOG.md index dfd5322b35070e99aa07928b18f73c4832e9227a..824ff3ead2a460ffaccf20e6573838fdca6eabab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ * deprecated rethrow_as * fixed circular import +* paths changed in pyproject.toml +* removed prints from unit tests +* fixed a subtle bug in _CPUProfileBuilderThread.get_own_cpu_usage # v2.25.5 diff --git a/README.md b/README.md index 3c3ebab159947b1c11cacde92dc3d70728d7b17a..1f11e0f8ece93921d37cab81345dcc2251bac4cf 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ coverage ``` It's still free, MIT-licensed and publicly available. No one's taking it from you :) -I'll try to submit the builds to PyPI as well + +**I'll try to submit the builds to regular [PyPI](https://pypi.org/project/satella/) as well!!** + What is Satella? ---------------- diff --git a/pyproject.toml b/pyproject.toml index 5f4771da2d7d218e28f11b24263b51df31dcbc64..f8eafb1ba6478ed2ec3036d25f28e2f053da97f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,11 +45,11 @@ max-line-length = 119 universal = true [project.urls] -Homepage = "https://github.com/piotrmaslanka/satella" -Documentation = "https://satella.readthedocs.io/" -Issues = "https://github.com/piotrmaslanka/satella/issues" -Repository = "https://github.com/piotrmaslanka/satella" -Changelog = "https://github.com/piotrmaslanka/satella/blob/develop/CHANGELOG.md" +Homepage = "https://git.dms-serwis.com.pl/smokserwis/satella" +Documentation = "https://smokserwis.docs.smok.co/satella" +Issues = "https://git.dms-serwis.com.pl/smokserwis/satella/-/issues" +Repository = "https://git.dms-serwis.com.pl/smokserwis/satella" +Changelog = "https://git.dms-serwis.com.pl/smokserwis/satella/-/blob/master/CHANGELOG.md?ref_type=heads" [tool.setuptools] packages = ["satella", diff --git a/satella/instrumentation/cpu_time/collector.py b/satella/instrumentation/cpu_time/collector.py index 95d244c63047f75fe8ec21db78ed33551a210045..d64097ab2e051df571e05eb6b0495a37f78b25a7 100644 --- a/satella/instrumentation/cpu_time/collector.py +++ b/satella/instrumentation/cpu_time/collector.py @@ -75,6 +75,7 @@ class _CPUProfileBuilderThread(SingleStartThread): time_c, times_c = self.own_load_average[-1] difference = time_c - time_p if difference == 0: + del self.own_load_average[-2] return None tuple_build = {} for field in times_v._fields: # pylint: disable=protected-access diff --git a/tests/test_coding/test_resources.py b/tests/test_coding/test_resources.py index c10c67da845c072d22166a4f285483672ef1e229..7f3d3896637a2921bb5de315175a0e33eed02d71 100644 --- a/tests/test_coding/test_resources.py +++ b/tests/test_coding/test_resources.py @@ -44,14 +44,12 @@ class TestResources(unittest.TestCase): def acquire_connection(self): v = super().acquire_connection() - print(f'Acquiring connection {v.id}') if v.id in self.already_acquired: raise RuntimeError('Reacquiring an acquired connection') self.already_acquired.add(v.id) return v def release_connection(self, connection) -> None: - print(f'Releasing connection {connection.id}') self.already_acquired.remove(connection.id) super().release_connection(connection) diff --git a/tests/test_instrumentation/test_cpu_time.py b/tests/test_instrumentation/test_cpu_time.py index bedf4431f9f62faad20c2250f671928e7a4c2964..a2b9c72d5bfeaec06fa1a82d366748485249fb20 100644 --- a/tests/test_instrumentation/test_cpu_time.py +++ b/tests/test_instrumentation/test_cpu_time.py @@ -61,9 +61,9 @@ class TestCPUTime(unittest.TestCase): try: with measure(timeout=30) as m: while not m.timeouted: - time.sleep(5) + time.sleep(10) usage = get_own_cpu_usage() - if usage.user > 0.9: + if usage.user > 0.6: break else: self.fail('Timeout when waiting for significant CPU usage')