diff options
Diffstat (limited to 'test/unit/test_patterns.py')
-rw-r--r-- | test/unit/test_patterns.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/unit/test_patterns.py b/test/unit/test_patterns.py index 99e1ed5..f2eeaf8 100644 --- a/test/unit/test_patterns.py +++ b/test/unit/test_patterns.py @@ -21,17 +21,13 @@ import pytest from ..script_loader import load_script -@pytest.fixture(scope="session") -def patterns_code(): - yield load_script('common/patterns.js', ['common']) - @pytest.mark.get_page('https://gotmyowndoma.in') -def test_regexes(execute_in_page, patterns_code): +def test_regexes(execute_in_page): """ patterns.js contains regexes used for URL parsing. Verify they work properly. """ - execute_in_page(patterns_code) + execute_in_page(load_script('common/patterns.js')) valid_url = 'https://example.com/a/b?ver=1.2.3#heading2' valid_url_rest = 'example.com/a/b?ver=1.2.3#heading2' @@ -92,12 +88,12 @@ def test_regexes(execute_in_page, patterns_code): assert match is None @pytest.mark.get_page('https://gotmyowndoma.in') -def test_deconstruct_url(execute_in_page, patterns_code): +def test_deconstruct_url(execute_in_page): """ patterns.js contains deconstruct_url() function that handles URL parsing. Verify it works properly. """ - execute_in_page(patterns_code) + execute_in_page(load_script('common/patterns.js')) deco = execute_in_page('returnval(deconstruct_url(arguments[0]));', 'https://eXaMpLe.com/a/b?ver=1.2.3#heading2') |