@@ -31,6 +31,7 @@ def test_anything(self):
3131import unittest
3232import uuid
3333from bs4 import BeautifulSoup
34+ from seleniumbase import config as sb_config
3435from seleniumbase .common import decorators
3536from seleniumbase .config import settings
3637from seleniumbase .core .application_manager import ApplicationManager
@@ -2727,7 +2728,7 @@ def setUp(self):
27272728 self .is_pytest = None
27282729 try :
27292730 # This raises an exception if the test is not coming from pytest
2730- self .is_pytest = pytest . config . option .is_pytest
2731+ self .is_pytest = sb_config .is_pytest
27312732 except Exception :
27322733 # Not using pytest (probably nosetests)
27332734 self .is_pytest = False
@@ -2736,34 +2737,33 @@ def setUp(self):
27362737 test_id = "%s.%s.%s" % (self .__class__ .__module__ ,
27372738 self .__class__ .__name__ ,
27382739 self ._testMethodName )
2739- self .environment = pytest .config .option .environment
2740+ self .browser = sb_config .browser
2741+ self .data = sb_config .data
2742+ self .demo_mode = sb_config .demo_mode
2743+ self .demo_sleep = sb_config .demo_sleep
2744+ self .highlights = sb_config .highlights
2745+ self .environment = sb_config .environment
27402746 self .env = self .environment # Add a shortened version
2741- self .with_selenium = pytest . config . option . with_selenium
2742- self .headless = pytest . config . option .headless
2747+ self .with_selenium = sb_config . with_selenium # Should be True
2748+ self .headless = sb_config .headless
27432749 self .headless_active = False
2744- self .with_testing_base = pytest .config .option .with_testing_base
2745- self .with_db_reporting = pytest .config .option .with_db_reporting
2746- self .with_s3_logging = pytest .config .option .with_s3_logging
2747- self .with_screen_shots = pytest .config .option .with_screen_shots
2748- self .with_basic_test_info = (
2749- pytest .config .option .with_basic_test_info )
2750- self .with_page_source = pytest .config .option .with_page_source
2751- self .servername = pytest .config .option .servername
2752- self .port = pytest .config .option .port
2753- self .proxy_string = pytest .config .option .proxy_string
2754- self .cap_file = pytest .config .option .cap_file
2755- self .database_env = pytest .config .option .database_env
2756- self .log_path = pytest .config .option .log_path
2757- self .browser = pytest .config .option .browser
2758- self .data = pytest .config .option .data
2759- self .demo_mode = pytest .config .option .demo_mode
2760- self .demo_sleep = pytest .config .option .demo_sleep
2761- self .highlights = pytest .config .option .highlights
2762- self .message_duration = pytest .config .option .message_duration
2763- self .js_checking_on = pytest .config .option .js_checking_on
2764- self .ad_block_on = pytest .config .option .ad_block_on
2765- self .verify_delay = pytest .config .option .verify_delay
2766- self .timeout_multiplier = pytest .config .option .timeout_multiplier
2750+ self .log_path = sb_config .log_path
2751+ self .with_testing_base = sb_config .with_testing_base
2752+ self .with_basic_test_info = sb_config .with_basic_test_info
2753+ self .with_screen_shots = sb_config .with_screen_shots
2754+ self .with_page_source = sb_config .with_page_source
2755+ self .with_db_reporting = sb_config .with_db_reporting
2756+ self .with_s3_logging = sb_config .with_s3_logging
2757+ self .servername = sb_config .servername
2758+ self .port = sb_config .port
2759+ self .proxy_string = sb_config .proxy_string
2760+ self .cap_file = sb_config .cap_file
2761+ self .database_env = sb_config .database_env
2762+ self .message_duration = sb_config .message_duration
2763+ self .js_checking_on = sb_config .js_checking_on
2764+ self .ad_block_on = sb_config .ad_block_on
2765+ self .verify_delay = sb_config .verify_delay
2766+ self .timeout_multiplier = sb_config .timeout_multiplier
27672767 self .use_grid = False
27682768 if self .servername != "localhost" :
27692769 # Use Selenium Grid (Use --server=127.0.0.1 for localhost Grid)
@@ -2898,7 +2898,7 @@ def tearDown(self):
28982898 self .is_pytest = None
28992899 try :
29002900 # This raises an exception if the test is not coming from pytest
2901- self .is_pytest = pytest . config . option .is_pytest
2901+ self .is_pytest = sb_config .is_pytest
29022902 except Exception :
29032903 # Not using pytest (probably nosetests)
29042904 self .is_pytest = False
0 commit comments