Skip to content

Commit

Permalink
Migrate to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Feb 27, 2023
1 parent 487c71e commit 96a70d3
Show file tree
Hide file tree
Showing 17 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pip install -r requirements/ci.txt
- name: Tests
run: |
nosetests tests --with-cov
pytest tests --cov
- name: Post Coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion holmium/core/pageobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ class MyPage(Page):
"""

def __init__(self, locator_type, query_string, iframe=None, timeout=0):

super(Section, self).__init__()
self.touched = False
self.locator_type = locator_type
Expand Down
3 changes: 2 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r main.txt
coverage
nose-cov
pytest
pytest-cov
hiro
mock
flask
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/config_tests.py → tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def test_config_default_reference(self):
)

def test_holmium_config_object(self):

cfg = HolmiumConfig(1, 2, 3, 4, 5, 6, 7)
self.assertEqual(
cfg,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 2 additions & 6 deletions tests/testcase_tests.py → tests/test_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def test_auto_config_json(self):
op.return_value.read.return_value = (
'{"default": {"test": 1}}' # noqa: E501
)
runtc(
{"HO_BROWSER": "chrome"}, [lambda s: s.config["test"] == 1]
)
runtc({"HO_BROWSER": "chrome"}, [lambda s: s.config["test"] == 1])

def test_auto_config_py(self):
with mock.patch("os.path.isfile") as isfile:
Expand All @@ -111,9 +109,7 @@ def test_auto_config_py(self):
m_config = mock.Mock()
m_config.config = {"default": {"test": 1}}
load_source.return_value = m_config
runtc(
{"HO_BROWSER": "chrome"}, [lambda s: s.config["test"] == 1]
)
runtc({"HO_BROWSER": "chrome"}, [lambda s: s.config["test"] == 1])

def test_set_useragent(self):
with mock.patch.dict(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tests.utils import get_driver, make_temp_page


class WaitConditionTests(unittest.TestCase):
class TestWaitCondition(unittest.TestCase):
def setUp(self):
self.driver = get_driver()
self.uri = make_temp_page("<div id='simple_id'>default text</div>")
Expand Down

0 comments on commit 96a70d3

Please sign in to comment.