Skip to content

Commit

Permalink
Merge pull request #104 from eldaduzman/improve-pylint-score-and-coverag
Browse files Browse the repository at this point in the history
improve pylint score and coverag
  • Loading branch information
eldaduzman committed Dec 16, 2023
2 parents 21cb619 + 4bb649a commit a1676ca
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[MASTER]
init-hook='import sys; sys.path.append(".")'
[FORMAT]
max-line-length=90
max-line-length=200
8 changes: 4 additions & 4 deletions docs/badges/pylint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/GeventLibrary/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# pylint: disable=missing-module-docstring
# pylint: disable=invalid-name
from .gevent_library import GeventLibrary
6 changes: 4 additions & 2 deletions src/GeventLibrary/gevent_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
# genevt monkey patch should be placed at the top
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-order
from gevent import monkey

from gevent import monkey # mypy: disable


monkey.patch_all(thread=False)
Expand Down Expand Up @@ -75,7 +76,8 @@ def __init__(self, patch_threads: bool = False):
"""
Args:
patch_threads (bool, optional): This is an experimental flag to solve the issue with robotframework SSH library. see - https://github.com/eldaduzman/robotframework-gevent/issues/94. Defaults to False.
patch_threads (bool, optional): This is an experimental flag to solve the issue with robotframework SSH library.
see - https://github.com/eldaduzman/robotframework-gevent/issues/94. Defaults to False.
"""
# self.ROBOT_LIBRARY_LISTENER = self # currently a listener is not needed...
DynamicCore.__init__(self, GeventLibrary.libraries)
Expand Down
1 change: 1 addition & 0 deletions src/GeventLibrary/keywords/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# pylint: disable=missing-module-docstring
from .gevent_keywords import GeventKeywords
7 changes: 7 additions & 0 deletions utests/test_bundle_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
BundleHasNoCoroutines,
)
from GeventLibrary.keywords.gevent_keywords import GeventKeywords
from GeventLibrary.gevent_library import GeventLibrary


class TestInstanceCreation(TestCase):
Expand All @@ -20,6 +21,12 @@ def test_instantiate_keywords_class(self):
gevent_library_instance = GeventKeywords()
self.assertEqual(0, len(gevent_library_instance))

def test_instantiate_keywords_class_patch_threads(self):
"""when a new keyword instance is created,
it should have no bundle of coroutines"""
gevent_library_instance = GeventLibrary(patch_threads=True)
print(gevent_library_instance)

def test_create_empty_bundle_with_alias(self):
"""When we add a new bundle of coroutines, length should be increased to 1,
this instance should not contain any coroutines yet"""
Expand Down

0 comments on commit a1676ca

Please sign in to comment.