Skip to content

Commit 0e76242

Browse files
committed
Move rare imports to live with specific code
1 parent 6143db6 commit 0e76242

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def test_anything(self):
2121
Code becomes greatly simplified and easier to maintain.
2222
"""
2323

24-
import getpass
2524
import logging
2625
import math
2726
import os
@@ -30,7 +29,6 @@ def test_anything(self):
3029
import requests
3130
import sys
3231
import time
33-
import traceback
3432
import unittest
3533
import uuid
3634
from bs4 import BeautifulSoup
@@ -3033,6 +3031,7 @@ def setUp(self):
30333031
# Use Selenium Grid (Use --server=127.0.0.1 for localhost Grid)
30343032
self.use_grid = True
30353033
if self.with_db_reporting:
3034+
import getpass
30363035
self.execution_guid = str(uuid.uuid4())
30373036
self.testcase_guid = None
30383037
self.execution_start_time = 0
@@ -3096,6 +3095,7 @@ def __insert_test_result(self, state, err):
30963095
data_payload.execution_guid = self.execution_guid
30973096
data_payload.state = state
30983097
if err:
3098+
import traceback
30993099
tb_string = traceback.format_exc()
31003100
if "Message: " in tb_string:
31013101
data_payload.message = "Message: " + tb_string.split(

0 commit comments

Comments
 (0)